)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"4a624e3b5bba83c49fb65cb3786493f712dbae72","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"When a floating ip is associated, packets to external network are"},{"line_number":16,"context_line":"routed through fip namespace because of ip rule[1]."},{"line_number":17,"context_line":"Before leaving the packet, SNAT is applied [2]."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"But for existing connections to external network only ip rule [1]"},{"line_number":20,"context_line":"is applied and SNAT [2] is not applied becuase of connection tracking entry [3]."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba3cc151_ba93b3f9","line":17,"updated":"2015-07-07 18:56:05.000000000","message":"nit: leaving the packet doesn\u0027t make sense","commit_id":"7a805ded802a7fb5c16df278119ed73b35ae5dc9"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"4a624e3b5bba83c49fb65cb3786493f712dbae72","unresolved":false,"context_lines":[{"line_number":23,"context_line":"with local ip and will never get reply packet, hence the"},{"line_number":24,"context_line":"connections will be in hung state."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Before assigning flaoting-ip, existing connections will be using SNAT"},{"line_number":27,"context_line":"gateway to reach external network because of [4]."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"To avoid connection loss, we will continue routing these existing"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba3cc151_1a85ffab","line":26,"updated":"2015-07-07 18:56:05.000000000","message":"nit: floating-ip","commit_id":"7a805ded802a7fb5c16df278119ed73b35ae5dc9"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"4a624e3b5bba83c49fb65cb3786493f712dbae72","unresolved":false,"context_lines":[{"line_number":40,"context_line":"key value used by ip rule [6]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"3) restore the packet mark, from the connection, so that packet"},{"line_number":43,"context_line":"will be handled by route with fwmark"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"[1] 32777:  from 10.0.0.8 lookup 16"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba3cc151_9a34affb","line":43,"updated":"2015-07-07 18:56:05.000000000","message":"I assume this is a reference to [7] below?","commit_id":"7a805ded802a7fb5c16df278119ed73b35ae5dc9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e6e68f78d4372a8904b496a56dbc02cffa4798a9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     venkata anil \u003canil.venkata@enovance.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-07 09:20:22 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DVR: avoid connection loss on floating ip associate"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In DVR, when a floating ip is associated with a port, existing"},{"line_number":10,"context_line":"connections to external network will be hung(and unresponsive)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da20952f_a6f8e14a","line":7,"updated":"2015-09-01 23:07:03.000000000","message":"nit:  I think this commit message is a bit verbose.  IMO, it should state what is changing and leave the details of the problem to the bug report.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     venkata anil \u003canil.venkata@enovance.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-07 09:20:22 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"DVR: avoid connection loss on floating ip associate"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In DVR, when a floating ip is associated with a port, existing"},{"line_number":10,"context_line":"connections to external network will be hung(and unresponsive)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da20952f_1b4d7699","line":7,"in_reply_to":"da20952f_a6f8e14a","updated":"2015-09-08 14:23:53.000000000","message":"Agree with you. But can I change commit message as suggested after review from some more people?","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e6e68f78d4372a8904b496a56dbc02cffa4798a9","unresolved":false,"context_lines":[{"line_number":26,"context_line":"with local ip and will never get reply packet, hence the"},{"line_number":27,"context_line":"connections will be in hung state."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"To avoid connection loss on floating ip associate for existing connections,"},{"line_number":30,"context_line":"we will continue routing packets belonging to existing connections through"},{"line_number":31,"context_line":"SNAT gateway[2] by marking packets and routing them through new"},{"line_number":32,"context_line":"fwmark[6] routes to SNAT gateway."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da20952f_86927df5","line":29,"updated":"2015-09-01 23:07:03.000000000","message":"Seem like the commit message should start about here.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"5036f2966b08e2d59f5d2d9be75fa67d0c6783a7","unresolved":false,"context_lines":[{"line_number":56,"context_line":"[6] 32769:  from 10.0.0.1/24 fwmark 0xa000001 lookup 167772161"},{"line_number":57,"context_line":"[7] icmp 1 29 src\u003d10.0.0.8 dst\u003d8.8.8.8 [UNREPLIED] src\u003d8.8.8.8 dst\u003d10.0.0.8 mark\u003d167772161 use\u003d1"},{"line_number":58,"context_line":"[8] CONNMARK  all  --  *  *  10.0.0.8  0.0.0.0/0  ctorigsrc 10.0.0.8 CONNMARK restore"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Closes-bug: #1456624"},{"line_number":61,"context_line":"Change-Id: Ia668f48972a665ad8307d44fab26f7b1668b65e1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"ba15a1d1_7f54a053","line":59,"updated":"2015-09-13 01:51:21.000000000","message":"Rather than have this in the commit message, the explanation should really be pulled into a devref that is part of this patchset.","commit_id":"f37ead99327b285683e6c08e19ce7bbb54e0b726"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"dbf6d806f166b6b859754830ee9d2ef6d2a8c163","unresolved":false,"context_lines":[{"line_number":10,"context_line":"https://bugs.launchpad.net/neutron/+bug/1456624/comments/7"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"To avoid connection loss on floating ip associate for existing connections,"},{"line_number":13,"context_line":"we will continue routing packets belonging to existing connections through"},{"line_number":14,"context_line":"SNAT gateway[2] by marking packets and routing them through new"},{"line_number":15,"context_line":"fwmark[6] routes to SNAT gateway."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"1) create snat redirect route(with fwmark)[6] for redirecting marked packets to SNAT"},{"line_number":18,"context_line":"default gateway(table)[2]. This is route is created per router internal port(subnet)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"bae84128_a324b20c","line":15,"range":{"start_line":13,"start_character":8,"end_line":15,"end_character":33},"updated":"2016-02-24 05:41:47.000000000","message":"It makes me feeling discordant. If existing conntrack will block floatingip to work, why not clean certain conntrack in router namespace when associate a floatingip?\n\nClean stale conntrack records can make floatingip work, if that why do still need route packets by SNAT gateway?","commit_id":"5742f2b65057eb20d7ab02cea08c235fb75ab9d0"}],"neutron/agent/l3/dvr_fip_ns.py":[{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"5036f2966b08e2d59f5d2d9be75fa67d0c6783a7","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            ri.dist_fip_count \u003d len(fip_cidrs)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def scan_fwmark_iprules(self, ri):"},{"line_number":250,"context_line":"        \"\"\"Reserve priorities for existing snat fwmark ip rules."},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"           When agent restarts, scan for ip rules with fwmark in router"},{"line_number":253,"context_line":"           namespace. If a snat redirect ip rule with fwmark exists,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_dfd5acb9","line":250,"updated":"2015-09-13 01:51:21.000000000","message":"This method doesn\u0027t look like it is doing what it claims.  In Ls268-269, if the allocation doesn\u0027t give me the correct priority, I don\u0027t end up reserving any priority value.","commit_id":"f37ead99327b285683e6c08e19ce7bbb54e0b726"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"4af98c3ab948ebef2368be126d06681038175367","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            ri.dist_fip_count \u003d len(fip_cidrs)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def scan_fwmark_iprules(self, ri):"},{"line_number":250,"context_line":"        \"\"\"Reserve priorities for existing snat fwmark ip rules."},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"           When agent restarts, scan for ip rules with fwmark in router"},{"line_number":253,"context_line":"           namespace. If a snat redirect ip rule with fwmark exists,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_94d86055","line":250,"in_reply_to":"ba15a1d1_7be57ea6","updated":"2015-09-14 13:20:42.000000000","message":"In this case i.e when we can\u0027t trust the priorites stored in \u0027fip-priorities\u0027 file, then I guess, for the same floatingip also we will have two entries in namespace for ip rules(because of line 245)? right?","commit_id":"f37ead99327b285683e6c08e19ce7bbb54e0b726"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"463ef04d34f1ceab0a7902efd66771c53564507e","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            ri.dist_fip_count \u003d len(fip_cidrs)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def scan_fwmark_iprules(self, ri):"},{"line_number":250,"context_line":"        \"\"\"Reserve priorities for existing snat fwmark ip rules."},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"           When agent restarts, scan for ip rules with fwmark in router"},{"line_number":253,"context_line":"           namespace. If a snat redirect ip rule with fwmark exists,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_7be57ea6","line":250,"in_reply_to":"ba15a1d1_80b90131","updated":"2015-09-14 12:37:01.000000000","message":"Then I fail to see how you avoid priority collisions with new rules that might appear.  I would expect that you would reserve the priority levels that exist in the table to begin with","commit_id":"f37ead99327b285683e6c08e19ce7bbb54e0b726"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"da659be2b53c48bca1b39c24dc59f39ff912d6e9","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            ri.dist_fip_count \u003d len(fip_cidrs)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def scan_fwmark_iprules(self, ri):"},{"line_number":250,"context_line":"        \"\"\"Reserve priorities for existing snat fwmark ip rules."},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"           When agent restarts, scan for ip rules with fwmark in router"},{"line_number":253,"context_line":"           namespace. If a snat redirect ip rule with fwmark exists,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_80b90131","line":250,"in_reply_to":"ba15a1d1_dfd5acb9","updated":"2015-09-14 12:00:33.000000000","message":"Yes. Line 267 always has to give the correct priority, if not, then we can\u0027t trust the priorites stored in \u0027fip-priorities\u0027 for floatingip\u0027s and snat redirect CIDR\u0027s.\nAs we can\u0027t rely on these newly allocated priorities, we will release them.","commit_id":"f37ead99327b285683e6c08e19ce7bbb54e0b726"}],"neutron/agent/l3/dvr_local_router.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e6e68f78d4372a8904b496a56dbc02cffa4798a9","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            self.iptables_manager.ipv4[\u0027nat\u0027].add_rule(*rule)"},{"line_number":71,"context_line":"        self.iptables_manager.apply()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _get_internal_gw_cidr_for_ip_adress(self, ip_address):"},{"line_number":74,"context_line":"        \"\"\"Return router\u0027s internal gateway cidr based on ip_address."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"           From router internal ports get the subnets connected to router"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_49d23636","line":73,"updated":"2015-09-01 23:07:03.000000000","message":"nit:  s/adress/address/","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            self.iptables_manager.ipv4[\u0027nat\u0027].add_rule(*rule)"},{"line_number":71,"context_line":"        self.iptables_manager.apply()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _get_internal_gw_cidr_for_ip_adress(self, ip_address):"},{"line_number":74,"context_line":"        \"\"\"Return router\u0027s internal gateway cidr based on ip_address."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"           From router internal ports get the subnets connected to router"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_3b563a2b","line":73,"in_reply_to":"da20952f_49d23636","updated":"2015-09-08 14:23:53.000000000","message":"sure, thanks","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":8282,"name":"Dong Liu","email":"willowd878@gmail.com","username":"liudong"},"change_message_id":"03848a76a6a93196ab0197bd1c01a737e2cd19ea","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                    for fixed_ip in p[\u0027fixed_ips\u0027]:"},{"line_number":91,"context_line":"                        if fixed_ip[\u0027ip_address\u0027] \u003d\u003d ip_address:"},{"line_number":92,"context_line":"                            return common_utils.ip_to_cidr(f[\u0027ip_address\u0027],"},{"line_number":93,"context_line":"                                                           f[\u0027prefixlen\u0027])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mark_exising_connections(self, fixed_ip, floating_ip):"},{"line_number":96,"context_line":"        \"\"\"Mark existing connections with this fixed_ip for SNAT."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_c693474e","line":93,"updated":"2015-08-28 09:15:45.000000000","message":"I think the loop is too deep. But I have no good idea about it :(","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                    for fixed_ip in p[\u0027fixed_ips\u0027]:"},{"line_number":91,"context_line":"                        if fixed_ip[\u0027ip_address\u0027] \u003d\u003d ip_address:"},{"line_number":92,"context_line":"                            return common_utils.ip_to_cidr(f[\u0027ip_address\u0027],"},{"line_number":93,"context_line":"                                                           f[\u0027prefixlen\u0027])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mark_exising_connections(self, fixed_ip, floating_ip):"},{"line_number":96,"context_line":"        \"\"\"Mark existing connections with this fixed_ip for SNAT."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_9b20a6b2","line":93,"in_reply_to":"da20952f_58de1912","updated":"2015-09-08 14:23:53.000000000","message":"sure. I have a better way :)","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                    for fixed_ip in p[\u0027fixed_ips\u0027]:"},{"line_number":91,"context_line":"                        if fixed_ip[\u0027ip_address\u0027] \u003d\u003d ip_address:"},{"line_number":92,"context_line":"                            return common_utils.ip_to_cidr(f[\u0027ip_address\u0027],"},{"line_number":93,"context_line":"                                                           f[\u0027prefixlen\u0027])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mark_exising_connections(self, fixed_ip, floating_ip):"},{"line_number":96,"context_line":"        \"\"\"Mark existing connections with this fixed_ip for SNAT."}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_58de1912","line":93,"in_reply_to":"da20952f_c693474e","updated":"2015-09-03 20:19:15.000000000","message":"+1 I wonder if there is a better way too","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":8282,"name":"Dong Liu","email":"willowd878@gmail.com","username":"liudong"},"change_message_id":"03848a76a6a93196ab0197bd1c01a737e2cd19ea","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                            return common_utils.ip_to_cidr(f[\u0027ip_address\u0027],"},{"line_number":93,"context_line":"                                                           f[\u0027prefixlen\u0027])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mark_exising_connections(self, fixed_ip, floating_ip):"},{"line_number":96,"context_line":"        \"\"\"Mark existing connections with this fixed_ip for SNAT."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"           If any conntrack entry exists with fixed_ip as source ip"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_d2646623","line":95,"updated":"2015-08-28 09:15:45.000000000","message":"s/exising/existing/","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                            return common_utils.ip_to_cidr(f[\u0027ip_address\u0027],"},{"line_number":93,"context_line":"                                                           f[\u0027prefixlen\u0027])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mark_exising_connections(self, fixed_ip, floating_ip):"},{"line_number":96,"context_line":"        \"\"\"Mark existing connections with this fixed_ip for SNAT."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"           If any conntrack entry exists with fixed_ip as source ip"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_fb15224c","line":95,"in_reply_to":"da20952f_d2646623","updated":"2015-09-08 14:23:53.000000000","message":"sure, thanks","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        try:"},{"line_number":114,"context_line":"            ip_wrapr.netns.execute([\u0027conntrack\u0027, \u0027-U\u0027, \u0027conntrack\u0027, \u0027-s\u0027,"},{"line_number":115,"context_line":"                                   fixed_ip, \u0027--mark\u0027, snat_idx],"},{"line_number":116,"context_line":"                                   check_exit_code\u003dFalse)"},{"line_number":117,"context_line":"        except Exception:"},{"line_number":118,"context_line":"            return"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_5defeb86","line":116,"updated":"2015-09-03 20:19:15.000000000","message":"This looks like something that should be over in ip_conntrack.py","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        try:"},{"line_number":114,"context_line":"            ip_wrapr.netns.execute([\u0027conntrack\u0027, \u0027-U\u0027, \u0027conntrack\u0027, \u0027-s\u0027,"},{"line_number":115,"context_line":"                                   fixed_ip, \u0027--mark\u0027, snat_idx],"},{"line_number":116,"context_line":"                                   check_exit_code\u003dFalse)"},{"line_number":117,"context_line":"        except Exception:"},{"line_number":118,"context_line":"            return"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_56abc575","line":116,"in_reply_to":"da20952f_5defeb86","updated":"2015-09-08 14:23:53.000000000","message":"Thanks Brian Haley for suggestion.\nLooks like existing ip_conntrack.py has implementation for only deleting connections and is used only in iptables_firewall.py\nNow it is looking simpler here and moving this to ip_conntrack.py may need some more changes. Let me make this fix simpler.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        # Add iptable rule to restore mark into packets from connection mark"},{"line_number":121,"context_line":"        rule \u003d (\u0027-s %s -m conntrack --ctorigsrc %s -j CONNMARK --restore-mark\u0027"},{"line_number":122,"context_line":"            % (fixed_ip, fixed_ip))"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Tag the above iptable rule with floating-ip, so that this rule can be"},{"line_number":125,"context_line":"        # deleted while disassociating floating-ip"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_5d4b6b87","line":122,"updated":"2015-09-03 20:19:15.000000000","message":"Use dict as the args are the same.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5c734294c579e9e4bea622db8a2e521511371f85","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        # Add iptable rule to restore mark into packets from connection mark"},{"line_number":121,"context_line":"        rule \u003d (\u0027-s %s -m conntrack --ctorigsrc %s -j CONNMARK --restore-mark\u0027"},{"line_number":122,"context_line":"            % (fixed_ip, fixed_ip))"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Tag the above iptable rule with floating-ip, so that this rule can be"},{"line_number":125,"context_line":"        # deleted while disassociating floating-ip"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_a76b081f","line":122,"in_reply_to":"da20952f_5d4b6b87","updated":"2015-09-08 15:20:10.000000000","message":"I mean,\n\nrule \u003d (\u0027-s %(fixed_ip)s -m conntrack --ctorigsrc %(fixed_ip)s -j CONNMARK --restore-mark\u0027 % {\u0027fixed_ip\u0027: fixed_ip}","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"7fda01f14d459b72e30c2579a96357c54f107278","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        # Add iptable rule to restore mark into packets from connection mark"},{"line_number":121,"context_line":"        rule \u003d (\u0027-s %s -m conntrack --ctorigsrc %s -j CONNMARK --restore-mark\u0027"},{"line_number":122,"context_line":"            % (fixed_ip, fixed_ip))"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Tag the above iptable rule with floating-ip, so that this rule can be"},{"line_number":125,"context_line":"        # deleted while disassociating floating-ip"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_88027608","line":122,"in_reply_to":"da20952f_a76b081f","updated":"2015-09-09 06:52:52.000000000","message":"sure, thanks","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        # clear packet marking rule"},{"line_number":163,"context_line":"        tag \u003d \u0027%s\u0027 % (floating_ip)"},{"line_number":164,"context_line":"        self.iptables_manager.ipv4[\u0027mangle\u0027].clear_rules_by_tag(tag)"},{"line_number":165,"context_line":"        self.iptables_manager.apply()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        rtr_2_fip_name \u003d self.fip_ns.get_rtr_ext_device_name(self.router_id)"},{"line_number":168,"context_line":"        fip_2_rtr_name \u003d self.fip_ns.get_int_device_name(self.router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_980031ad","line":165,"updated":"2015-09-03 20:19:15.000000000","message":"So I\u0027m thinking you\u0027re using a tag here and above since it wasn\u0027t easy to match the iptables rule?  For example, the \"add\" above would look something like this:\n\n# iptables -t mangle -A PREROUTING -s 1.2.3.4 -m conntrack --ctorigsrc 1.2.3.4 --restore-mark\n\nAnd the resulting rule would be this:\n\n-A PREROUTING -s 1.2.3.4/32 -m conntrack --ctorigsrc 1.2.3.4 -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff\n\nI guess I\u0027m OK with this, but if you had a private method that was just used to build the rule you could use it here and above.  Just thinking out loud.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"7fda01f14d459b72e30c2579a96357c54f107278","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        # clear packet marking rule"},{"line_number":163,"context_line":"        tag \u003d \u0027%s\u0027 % (floating_ip)"},{"line_number":164,"context_line":"        self.iptables_manager.ipv4[\u0027mangle\u0027].clear_rules_by_tag(tag)"},{"line_number":165,"context_line":"        self.iptables_manager.apply()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        rtr_2_fip_name \u003d self.fip_ns.get_rtr_ext_device_name(self.router_id)"},{"line_number":168,"context_line":"        fip_2_rtr_name \u003d self.fip_ns.get_int_device_name(self.router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_cd016008","line":165,"in_reply_to":"da20952f_2a9fbd66","updated":"2015-09-09 06:52:52.000000000","message":"sure, I will have a look at that(after my next patchset)","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        # clear packet marking rule"},{"line_number":163,"context_line":"        tag \u003d \u0027%s\u0027 % (floating_ip)"},{"line_number":164,"context_line":"        self.iptables_manager.ipv4[\u0027mangle\u0027].clear_rules_by_tag(tag)"},{"line_number":165,"context_line":"        self.iptables_manager.apply()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        rtr_2_fip_name \u003d self.fip_ns.get_rtr_ext_device_name(self.router_id)"},{"line_number":168,"context_line":"        fip_2_rtr_name \u003d self.fip_ns.get_int_device_name(self.router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_b1202bb2","line":165,"in_reply_to":"da20952f_980031ad","updated":"2015-09-08 14:23:53.000000000","message":"Yes.\nCan you please elaborate more on private method approach?","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5c734294c579e9e4bea622db8a2e521511371f85","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        # clear packet marking rule"},{"line_number":163,"context_line":"        tag \u003d \u0027%s\u0027 % (floating_ip)"},{"line_number":164,"context_line":"        self.iptables_manager.ipv4[\u0027mangle\u0027].clear_rules_by_tag(tag)"},{"line_number":165,"context_line":"        self.iptables_manager.apply()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        rtr_2_fip_name \u003d self.fip_ns.get_rtr_ext_device_name(self.router_id)"},{"line_number":168,"context_line":"        fip_2_rtr_name \u003d self.fip_ns.get_int_device_name(self.router_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_2a9fbd66","line":165,"in_reply_to":"da20952f_b1202bb2","updated":"2015-09-08 15:20:10.000000000","message":"If you look over in iptables_firewall.py there are small helper functions like _allow_established() and others that return an iptables rule.  Having something like that here could let you use iptables_manager.remove_rule() with the matching info instead of tagging it.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        # command \u0027ip rule ls\u0027 shows fwmark in hex."},{"line_number":309,"context_line":"        # So update fwmark with hex value for matching in _exists."},{"line_number":310,"context_line":"        kwargs.update({\u0027fwmark\u0027: hex(fwmark), \u0027from\u0027: sn_port_cidr})"},{"line_number":311,"context_line":"        rule_exists \u003d ns_ipr.rule._exists(port_ip_vers, **kwargs)"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        # \u0027ip rule add/del\u0027 needs fwmark as decimal value"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_1d797382","line":310,"updated":"2015-09-03 20:19:15.000000000","message":"If this is a bug in the IPRule code lets get it fixed in a parent patch so all callers get fixed.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        # command \u0027ip rule ls\u0027 shows fwmark in hex."},{"line_number":309,"context_line":"        # So update fwmark with hex value for matching in _exists."},{"line_number":310,"context_line":"        kwargs.update({\u0027fwmark\u0027: hex(fwmark), \u0027from\u0027: sn_port_cidr})"},{"line_number":311,"context_line":"        rule_exists \u003d ns_ipr.rule._exists(port_ip_vers, **kwargs)"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        # \u0027ip rule add/del\u0027 needs fwmark as decimal value"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_f111c305","line":310,"in_reply_to":"da20952f_1d797382","updated":"2015-09-08 14:23:53.000000000","message":"sure, thanks","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        # command \u0027ip rule ls\u0027 shows fwmark in hex."},{"line_number":309,"context_line":"        # So update fwmark with hex value for matching in _exists."},{"line_number":310,"context_line":"        kwargs.update({\u0027fwmark\u0027: hex(fwmark), \u0027from\u0027: sn_port_cidr})"},{"line_number":311,"context_line":"        rule_exists \u003d ns_ipr.rule._exists(port_ip_vers, **kwargs)"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        # \u0027ip rule add/del\u0027 needs fwmark as decimal value"},{"line_number":314,"context_line":"        kwargs.update({\u0027fwmark\u0027: fwmark})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_7dd66f50","line":311,"updated":"2015-09-03 20:19:15.000000000","message":"rule.add already checks if it exists so this isn\u0027t necessary, gets back at my comment above.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        # command \u0027ip rule ls\u0027 shows fwmark in hex."},{"line_number":309,"context_line":"        # So update fwmark with hex value for matching in _exists."},{"line_number":310,"context_line":"        kwargs.update({\u0027fwmark\u0027: hex(fwmark), \u0027from\u0027: sn_port_cidr})"},{"line_number":311,"context_line":"        rule_exists \u003d ns_ipr.rule._exists(port_ip_vers, **kwargs)"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        # \u0027ip rule add/del\u0027 needs fwmark as decimal value"},{"line_number":314,"context_line":"        kwargs.update({\u0027fwmark\u0027: fwmark})"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_112a3730","line":311,"in_reply_to":"da20952f_7dd66f50","updated":"2015-09-08 14:23:53.000000000","message":"ok","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"004e45745d93d95f1806a05e6f1999a5ca324024","unresolved":false,"context_lines":[{"line_number":330,"context_line":"           This route will be per internal port(or subnet i.e 10.0.0.1/24)."},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"           For example, this will add/del below fwmark route"},{"line_number":333,"context_line":"           32768:\tfrom 10.0.0.1/24 fwmark 0xa000001 lookup 167772161"},{"line_number":334,"context_line":"           to redirect to table 167772161 i.e default snat route(to 10.0.0.6)"},{"line_number":335,"context_line":"           ip route show table 167772161"},{"line_number":336,"context_line":"           default via 10.0.0.6 dev qr-8804a198-ea"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_4689aec9","line":333,"updated":"2015-09-02 09:54:25.000000000","message":"nit: tab","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":330,"context_line":"           This route will be per internal port(or subnet i.e 10.0.0.1/24)."},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"           For example, this will add/del below fwmark route"},{"line_number":333,"context_line":"           32768:\tfrom 10.0.0.1/24 fwmark 0xa000001 lookup 167772161"},{"line_number":334,"context_line":"           to redirect to table 167772161 i.e default snat route(to 10.0.0.6)"},{"line_number":335,"context_line":"           ip route show table 167772161"},{"line_number":336,"context_line":"           default via 10.0.0.6 dev qr-8804a198-ea"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_312f3b40","line":333,"in_reply_to":"da20952f_4689aec9","updated":"2015-09-08 14:23:53.000000000","message":"sure","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e98f5c1bede4d79fed1036d6b52f2bd356fea60b","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                            ns_ipr.rule.delete(ip\u003dsn_port_cidr,"},{"line_number":383,"context_line":"                                               table\u003dsnat_idx,"},{"line_number":384,"context_line":"                                               priority\u003dsnat_idx)"},{"line_number":385,"context_line":"                        if self.fip_ns:"},{"line_number":386,"context_line":"                            self.update_fwmark_route(is_add, sn_port_cidr,"},{"line_number":387,"context_line":"                                                     table\u003dsnat_idx,"},{"line_number":388,"context_line":"                                                     fwmark\u003dsnat_idx)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_1d32d35e","line":385,"updated":"2015-09-03 20:19:15.000000000","message":"Can this ever be None?  I thought as long as there was a FIP the namespace could not go away?","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"e185eb682d23b1ca4cc11f333b4b6789af585b24","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                            ns_ipr.rule.delete(ip\u003dsn_port_cidr,"},{"line_number":383,"context_line":"                                               table\u003dsnat_idx,"},{"line_number":384,"context_line":"                                               priority\u003dsnat_idx)"},{"line_number":385,"context_line":"                        if self.fip_ns:"},{"line_number":386,"context_line":"                            self.update_fwmark_route(is_add, sn_port_cidr,"},{"line_number":387,"context_line":"                                                     table\u003dsnat_idx,"},{"line_number":388,"context_line":"                                                     fwmark\u003dsnat_idx)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_cc798284","line":385,"in_reply_to":"da20952f_1d32d35e","updated":"2015-09-08 14:23:53.000000000","message":"If external network is not set for router, this  will be null.\nWhen router has only internal networks and no external network, then we need this check.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"7fda01f14d459b72e30c2579a96357c54f107278","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                            ns_ipr.rule.delete(ip\u003dsn_port_cidr,"},{"line_number":383,"context_line":"                                               table\u003dsnat_idx,"},{"line_number":384,"context_line":"                                               priority\u003dsnat_idx)"},{"line_number":385,"context_line":"                        if self.fip_ns:"},{"line_number":386,"context_line":"                            self.update_fwmark_route(is_add, sn_port_cidr,"},{"line_number":387,"context_line":"                                                     table\u003dsnat_idx,"},{"line_number":388,"context_line":"                                                     fwmark\u003dsnat_idx)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_4871bea7","line":385,"in_reply_to":"da20952f_6d1b8f74","updated":"2015-09-09 06:52:52.000000000","message":"My code here (lines 385-388) is not under if-else of add/del gateway(369-384)\n\nTo add fwmark route, update_fwmark_route is called like below\n  update_fwmark_route(True, sn_port_cidr, table\u003dsnat_idx,  fwmark\u003dsnat_idx)\n\nTo delete fwmark route, update_fwmark_route is called like below\n  update_fwmark_route(False, sn_port_cidr, table\u003dsnat_idx,  fwmark\u003dsnat_idx)\n\nSo is_add will be a boolean - True or False.\nThanks","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"5c734294c579e9e4bea622db8a2e521511371f85","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                            ns_ipr.rule.delete(ip\u003dsn_port_cidr,"},{"line_number":383,"context_line":"                                               table\u003dsnat_idx,"},{"line_number":384,"context_line":"                                               priority\u003dsnat_idx)"},{"line_number":385,"context_line":"                        if self.fip_ns:"},{"line_number":386,"context_line":"                            self.update_fwmark_route(is_add, sn_port_cidr,"},{"line_number":387,"context_line":"                                                     table\u003dsnat_idx,"},{"line_number":388,"context_line":"                                                     fwmark\u003dsnat_idx)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_6d1b8f74","line":385,"in_reply_to":"da20952f_cc798284","updated":"2015-09-08 15:20:10.000000000","message":"Ok, I think your comment covers the \u0027add\u0027 case, but in the delete case don\u0027t you want to call update_fwmark_route() to delete the rule?  self.fip_ns is only used on one line in that method so it seems like we are missing something.","commit_id":"83d688b653902eb4cfb1ccb6eefa55708a486fd7"}]}
