)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e22715fe597376270d62fc85e0ba4b05162e9da2","unresolved":false,"context_lines":[{"line_number":25,"context_line":"first in host file, to avoid this issue."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Change-Id: I3bea58d86a3508e49cbac1d03c6b640836b4a7a2"},{"line_number":28,"context_line":"Closes-bug: #1456206"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa32b979_0f4b9c88","line":28,"updated":"2015-06-16 07:52:27.000000000","message":"The reporter claims in launchpad comments that the issue is present even when no extra_dhcp_opts are set for a port. Neither the bug description suggests it\u0027s the case. I don\u0027t think the bug is relevant. In any case, the fix does not close the bug, maybe Related-Bug is better.","commit_id":"2b66e787c26760084780240711465e7ddcf12b6f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"420e8259c13c46ffbbaa56c810ce5eb30b5a3e1d","unresolved":false,"context_lines":[{"line_number":17,"context_line":"host file will have only mac address and tag."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"If the last entry in host file for the port with extra_dhcp_opts,"},{"line_number":20,"context_line":"is for dhcpv6 stateless subnet, then dhclient tries to use this entry,"},{"line_number":21,"context_line":"to resolve dhcp request even for IPv4, treats as \u0027no address found\u0027"},{"line_number":22,"context_line":"and fails to send DHCPOFFER."},{"line_number":23,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa32b979_bba7dda5","line":20,"updated":"2015-06-18 10:51:47.000000000","message":"dhclient -\u003e dnsmasq.\n\nIt\u0027s quite scary that we rely on specific internal detail of dnsmasq implementation (the order in which it applies host rules) that is not documented.\n\nPlease make it explicit in commit message and in comment in the code that is the case.","commit_id":"d81d7a9b813f34567f7d6efc384091143632bca6"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            fixed_ips \u003d sorted(port.fixed_ips,"},{"line_number":455,"context_line":"                key\u003dlambda fip: netaddr.IPAddress(fip[\u0027ip_address\u0027]).version,"},{"line_number":456,"context_line":"                reverse\u003dTrue)"},{"line_number":457,"context_line":"            for alloc in fixed_ips:"},{"line_number":458,"context_line":"                # Note(scollins) Only create entries that are"},{"line_number":459,"context_line":"                # associated with the subnet being managed by this"},{"line_number":460,"context_line":"                # dhcp agent"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_1a4fbfbe","line":457,"updated":"2015-06-05 21:30:45.000000000","message":"Should this be submitted separately from the other change?  Are they really co-dependent?","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"07e193fbe6332abed0ee7836c938942163bd17bf","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            fixed_ips \u003d sorted(port.fixed_ips,"},{"line_number":455,"context_line":"                key\u003dlambda fip: netaddr.IPAddress(fip[\u0027ip_address\u0027]).version,"},{"line_number":456,"context_line":"                reverse\u003dTrue)"},{"line_number":457,"context_line":"            for alloc in fixed_ips:"},{"line_number":458,"context_line":"                # Note(scollins) Only create entries that are"},{"line_number":459,"context_line":"                # associated with the subnet being managed by this"},{"line_number":460,"context_line":"                # dhcp agent"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_cf184387","line":457,"in_reply_to":"3afb71cf_1a4fbfbe","updated":"2015-06-06 07:22:27.000000000","message":"No. Both the changes in the file are needed to fix this issue i.e \nwhen extra_dhcp_opts for stateless IPv6 enabled, dhcp for IPv4 failing, because \n1) creating lease file is failing\n2) dnsmasq is not using correct entry in hosts file to resolve IPv4 address for the same MAC  \nThese are the two functions in dnsmasq to resolve mac\nint is_config_in_context(struct dhcp_context *context, struct dhcp_config *config)\n{\n     ...\n     if (!(config-\u003eflags \u0026 (CONFIG_ADDR | CONFIG_ADDR6)))\n         return 1;\n     ...\n  for (; context; context \u003d context-\u003ecurrent)\n#ifdef HAVE_DHCP6\n    if (context-\u003eflags \u0026 CONTEXT_V6)\n      {\n        if ((config-\u003eflags \u0026 CONFIG_ADDR6) \u0026\u0026 is_same_net6(\u0026config-\u003eaddr6, \u0026context-\u003estart6, context-\u003eprefix))\n          return 1;\n      }\n    else\n#endif\n      if ((config-\u003eflags \u0026 CONFIG_ADDR) \u0026\u0026 is_same_net(config-\u003eaddr, context-\u003estart, context-\u003enetmask))\n        return 1;\n\n  return 0;\n\n}\n\nstruct dhcp_config *find_config(struct dhcp_config *configs,\n                                struct dhcp_context *context,\n                                unsigned char *clid, int clid_len,\n                                unsigned char *hwaddr, int hw_len,\n                                int hw_type, char *hostname)\n{\n  ...\n  if (hwaddr)\n    for (config \u003d configs; config; config \u003d config-\u003enext)\n      if (config_has_mac(config, hwaddr, hw_len, hw_type) \u0026\u0026\n          is_config_in_context(context, config))\n        return config;\n  ...\n}\nhttps://github.com/guns/dnsmasq/blob/nerv/src/dhcp-common.c#L275\nhttps://github.com/guns/dnsmasq/blob/nerv/src/dhcp-common.c#L287\nhttps://github.com/guns/dnsmasq/blob/nerv/src/dhcp-common.c#L292\nhttps://github.com/guns/dnsmasq/blob/nerv/src/dhcp-common.c#L328\n\nhost file entries, for example,\n\nfa:16:3e:8f:9d:65,host-30-0-0-5.openstacklocal,30.0.0.5,set:aabc7d33-4874-429e-9637-436e4232d2cd      (entry for IPv4)\n\nfa:16:3e:8f:9d:65,set:aabc7d33-4874-429e-9637-436e4232d2cd    (entry for stateless IPv6 for v6 options)\n\ndnsmaq reads the hosts file from EOF, and stores the each entry as a config in configs. When find_config called to resolve ip,  in above example hosts file, a) It first reads entry for stateless IPv6\n\nb) As no CONFIG_ADDR | CONFIG_ADDR6 flags found for this entry, it returns 1(L275)\n\nc) find_config will return this entry, as both is_config_in_conext and congig_has_mac are true, to resolve ip.\n\nd) As there is no ip in this entry, dnsmaq logs \"no address available\" and fails to send DHCPOFFER message.\n\nSo If we reverse the order of writing entries in host file, so that entry for dnsmasq comes first, then dnsmasq can correctly fetch the IPv4 address.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bfdbeac6c64cf99ace6d2bbd6ccba1caa556a0d2","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            fixed_ips \u003d sorted(port.fixed_ips,"},{"line_number":455,"context_line":"                key\u003dlambda fip: netaddr.IPAddress(fip[\u0027ip_address\u0027]).version,"},{"line_number":456,"context_line":"                reverse\u003dTrue)"},{"line_number":457,"context_line":"            for alloc in fixed_ips:"},{"line_number":458,"context_line":"                # Note(scollins) Only create entries that are"},{"line_number":459,"context_line":"                # associated with the subnet being managed by this"},{"line_number":460,"context_line":"                # dhcp agent"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_dd47961b","line":457,"in_reply_to":"3afb71cf_cf184387","updated":"2015-06-09 04:45:06.000000000","message":"Saying that \"both the changes in the file are needed to fix this issue\" is different than saying that the two changes are co-dependent.\n\nThe issue may require two fixes but that doesn\u0027t mean that the two fixes cannot be submitted separately.  I\u0027m still trying to figure out which unit test exposes the problem that you fixed on L559.  If the two were submitted separately, it might be easier to spot.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"d19bdd1ab2fa593c34e19812dd7b36fbf175e654","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            fixed_ips \u003d sorted(port.fixed_ips,"},{"line_number":455,"context_line":"                key\u003dlambda fip: netaddr.IPAddress(fip[\u0027ip_address\u0027]).version,"},{"line_number":456,"context_line":"                reverse\u003dTrue)"},{"line_number":457,"context_line":"            for alloc in fixed_ips:"},{"line_number":458,"context_line":"                # Note(scollins) Only create entries that are"},{"line_number":459,"context_line":"                # associated with the subnet being managed by this"},{"line_number":460,"context_line":"                # dhcp agent"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_54381cef","line":457,"in_reply_to":"3afb71cf_dd47961b","updated":"2015-06-09 07:21:47.000000000","message":"I thought I should submit all the changes needed to fix this issue, should be part of one change. Agree with you that submitting two changes might have made review easier and clear. I will do that.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    client_id \u003d None"},{"line_number":559,"context_line":"                    # No ip address in hosts file for dhcpv6"},{"line_number":560,"context_line":"                    # stateless extra_dhcp_opts"},{"line_number":561,"context_line":"                    if host[1].startswith(\u0027set:\u0027):"},{"line_number":562,"context_line":"                        continue"},{"line_number":563,"context_line":"                    if host[1].startswith(self._ID):"},{"line_number":564,"context_line":"                        ip \u003d host[3].strip(\u0027[]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_345a9184","line":561,"updated":"2015-06-05 21:30:45.000000000","message":"I can\u0027t figure out why we would find \"set:\" in position 1 here.  From reading _output_hosts_file, it appears the format is like one of the following (L525, L529, L533, and L537):\n\n mac_address,id:client_id,name,ip_address,set:port_id\n mac_address,id:client_id,name,ip_address\n mac_address,name,ip_address,set:port_id\n mac_address,name,ip_address\n\nI would expect \"set:\" to appear in either position 3 or 4 but not 1.  This must be wrong, right?\n\nnit:  I would suggest a constant instead of a magic string.  Like _ID.  But, I see that the rest of the code in this file has already set the precedent so I\u0027ll look the other way.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"07e193fbe6332abed0ee7836c938942163bd17bf","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    client_id \u003d None"},{"line_number":559,"context_line":"                    # No ip address in hosts file for dhcpv6"},{"line_number":560,"context_line":"                    # stateless extra_dhcp_opts"},{"line_number":561,"context_line":"                    if host[1].startswith(\u0027set:\u0027):"},{"line_number":562,"context_line":"                        continue"},{"line_number":563,"context_line":"                    if host[1].startswith(self._ID):"},{"line_number":564,"context_line":"                        ip \u003d host[3].strip(\u0027[]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_afbbc7c3","line":561,"in_reply_to":"3afb71cf_345a9184","updated":"2015-06-06 07:22:27.000000000","message":"As I explained in the commit message, for a port with extra_dhcp_opts on a stateless IPv6 suubnet, below entry will be added(through L507 of this file)\n\nmac_address,set:port_id \n\nSo when parsing hosts file, this function will see \"set:\" in position 1 and fails with below error\n\n\n2015-06-06 04:40:51.141 ERROR neutron.agent.dhcp.agent [req-f460f3a2-d344-4b88-9bde-2a6f339e22d0 admin11babcdeb88542c38da7d02b34df3093] Unable to reload_allocations dhcp for fae8b613-dda0-4a0e-bae8-57142ce6532b.\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent Traceback (most recent call last):\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent   File \"/opt/stack/neutron/neutron/agent/dhcp/agent.py\", line 112, in call_driver\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent     getattr(driver, action)(**action_kwargs)\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent   File \"/opt/stack/neutron/neutron/agent/linux/dhcp.py\", line 428, in reload_allocations\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent     self._release_unused_leases()\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent   File \"/opt/stack/neutron/neutron/agent/linux/dhcp.py\", line 563, in _release_unused_leases\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent     old_leases \u003d self._read_hosts_file_leases(filename)\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent   File \"/opt/stack/neutron/neutron/agent/linux/dhcp.py\", line 555, in _read_hosts_file_leases\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent     ip \u003d host[2].strip(\u0027[]\u0027)\n\n2015-06-06 04:40:51.141 TRACE neutron.agent.dhcp.agent IndexError: list index out of range\n\n\nTo avoid this error(and no need to have IPv6 stateless address in lease file), I have added this here.\n\n\nWith these minor changes only I am confusing reviewers :). So I am scared to take any new changes :)","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7045e38a5f23acedfbf66f84afb4c417a776b55c","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    client_id \u003d None"},{"line_number":559,"context_line":"                    # No ip address in hosts file for dhcpv6"},{"line_number":560,"context_line":"                    # stateless extra_dhcp_opts"},{"line_number":561,"context_line":"                    if host[1].startswith(\u0027set:\u0027):"},{"line_number":562,"context_line":"                        continue"},{"line_number":563,"context_line":"                    if host[1].startswith(self._ID):"},{"line_number":564,"context_line":"                        ip \u003d host[3].strip(\u0027[]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_dabc876e","line":561,"in_reply_to":"3afb71cf_345a9184","updated":"2015-06-05 21:33:37.000000000","message":"I just posted [1] as an idea for how to avoid all of this hard-coded positional stuff.\n\n [1] https://review.openstack.org/188931","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"d19bdd1ab2fa593c34e19812dd7b36fbf175e654","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    client_id \u003d None"},{"line_number":559,"context_line":"                    # No ip address in hosts file for dhcpv6"},{"line_number":560,"context_line":"                    # stateless extra_dhcp_opts"},{"line_number":561,"context_line":"                    if host[1].startswith(\u0027set:\u0027):"},{"line_number":562,"context_line":"                        continue"},{"line_number":563,"context_line":"                    if host[1].startswith(self._ID):"},{"line_number":564,"context_line":"                        ip \u003d host[3].strip(\u0027[]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_7465581c","line":561,"in_reply_to":"3afb71cf_5dede623","updated":"2015-06-09 07:21:47.000000000","message":"Sorry, there is no UT which exposes this issue. I should have added \"test_read_hosts_file_leases_with_stateless_ipv6\". I will add this test.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bfdbeac6c64cf99ace6d2bbd6ccba1caa556a0d2","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                    client_id \u003d None"},{"line_number":559,"context_line":"                    # No ip address in hosts file for dhcpv6"},{"line_number":560,"context_line":"                    # stateless extra_dhcp_opts"},{"line_number":561,"context_line":"                    if host[1].startswith(\u0027set:\u0027):"},{"line_number":562,"context_line":"                        continue"},{"line_number":563,"context_line":"                    if host[1].startswith(self._ID):"},{"line_number":564,"context_line":"                        ip \u003d host[3].strip(\u0027[]\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_5dede623","line":561,"in_reply_to":"3afb71cf_afbbc7c3","updated":"2015-06-09 04:45:06.000000000","message":"Sorry, I missed L507.  Thank you for pointing that out and please accept my apology for being confused at first.  It is not easy to follow this parsing code and I still think it could be improved.  But, I see why this is correct and I won\u0027t ask you to change it here.\n\nI have one last question about this change.  Which UT change exposes this particular problem and prevents a regression?","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"420e8259c13c46ffbbaa56c810ce5eb30b5a3e1d","unresolved":false,"context_lines":[{"line_number":453,"context_line":"            # If not so and if a port has IPv4, IPv6 stateful and stateless"},{"line_number":454,"context_line":"            # subnets and the last entry with this port\u0027s MAC address in hosts"},{"line_number":455,"context_line":"            # file is for IPv6 stateless extra_dhcp_opts,"},{"line_number":456,"context_line":"            # dhclient uses this entry to resolve IPv4 and IPv6 stateful"},{"line_number":457,"context_line":"            # address requests and returns no address."},{"line_number":458,"context_line":"            fixed_ips \u003d sorted("},{"line_number":459,"context_line":"                port.fixed_ips,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_d8eae7da","line":456,"updated":"2015-06-18 10:51:47.000000000","message":"dhclient -\u003e dnsmasq","commit_id":"d81d7a9b813f34567f7d6efc384091143632bca6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"db98a4888387afbea337e74d490c0d452d3cd2e4","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            # file is for IPv6 stateless extra_dhcp_opts,"},{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_ffd46aec","line":458,"updated":"2015-06-18 13:16:08.000000000","message":"I\u0027m still a bit suspicious about the whole approach. It seems we rely on internal details of dnsmasq that are not documented anywhere. Any change in dnsmasq may break it.\n\nAnother concern of me is whether dnsmasq actually bails out unconditionally on the first entry found. If that is the case, we may have another problem, with multiple stateless subnets with extra dhcp options: once the first found will match, it will be applied to all subnets, while others may be ignored.\n\nI\u0027ve posted an email to dnsmasq-discuss mailing list to understand whether the approach is reasonable long term, and whether we miss anything substantial: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2015q2/009650.html","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7c4db4c1f87e082bbed003b454598684d03db845","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            # file is for IPv6 stateless extra_dhcp_opts,"},{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_121f1109","line":458,"in_reply_to":"fa32b979_4c4820cd","updated":"2015-06-23 15:38:03.000000000","message":"It still seems fragile as approach to me, anyway I can\u0027t suggest anything better. We should have a functional test to check that dnsmasq behaves as expected.","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bd668d5e01232ebdeda120d977bc65da130c43b9","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            # file is for IPv6 stateless extra_dhcp_opts,"},{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_4c4820cd","line":458,"in_reply_to":"fa32b979_e970300d","updated":"2015-06-19 11:48:47.000000000","message":"Ah right, thanks Anil for explanation. I somehow missed that extra_dhcp_opts are per-port, not per-subnet. In that case there is no issue with multiple stateless subnets.\n\nLet\u0027s wait for dnsmasq devs\u0027 response till Mon and then see whether we feel ok to merge.","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"372a0bd442fad799ae4e73a6e2b96e0ff2ef410a","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            # file is for IPv6 stateless extra_dhcp_opts,"},{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_e970300d","line":458,"in_reply_to":"fa32b979_ffd46aec","updated":"2015-06-18 15:11:58.000000000","message":"Thanks Ihar. Sorry for lengthy explanation here.\n\n[Ihar] \u0027m still a bit suspicious about the whole approach.\nIt seems we rely on internal details of dnsmasq that are not documented anywhere.\nAny change in dnsmasq may break it.\n\n[Anil] If a change to dnsmasq, to change the order of processing the entries\n in host file(now dnsmaq reads entries from EOF, if they do it from start of file),\n then it breaks current approach.\n\n[Ihar] Another concern of me is whether dnsmasq actually bails out \nunconditionally on the first entry found.\n[Anil] No, As I explained in\n https://review.openstack.org/#/c/185066/1/neutron/agent/linux/dhcp.py\n (my first gerrit comment at Line 457), it has checks. \nBut these checks are  insufficient(I think) if the first host entry picked by\n dnsmasq matching for a MAC for a request has only tag set i.e\n\nfa:16:3e:8f:9d:65,set:aabc7d33-4874-429e-9637-436e4232d2cd (entry for stateless IPv6 for v6 options)\n\nIt is not going for other entries in the host file for same MAC\n\n[Ihar] If that is the case, we may have another problem, with multiple stateless subnets with extra dhcp options:\n once the first found will match, it will be applied to all subnets, \nwhile others may be ignored.\n\n[Anil] I assume you are saying that  \"a port\" on multiple stateless subnets\n \"belonging to one network\" with extra dhcp options.\n If they don\u0027t belong to same network or same port, then it is not a problem\n as MAC is different.  \"extra_dhcp_options\" are port specific.  what I mean is\n1) port-id is the tag name( in neutron :))\n (so all IPV4 and IPv6 entries for same mac will use same tag name)\n2) On a port, extra_dhcp_options are categorized as IPv4 options or IPv6 options\n(not based on IPv6 SLAAC, stateless and stateful subnets). \nIf a vm with a port has IPv6 option, and this port has 2 stateless subnets and\n 1 stateful subnet, if atleast one subnet is operational(no radvd for stateless\n subnets, dhcpv6 address issue), then vm will get all IPV6 options with that\n tag name for IPv6 \"Information-request\" \n\n[Ihar] I\u0027ve posted an email to dnsmasq-discuss mailing list to understand \nwhether the approach is reasonable long term, and whether we miss \nanything substantial: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2015q2/009650.html\n [Anil] Thanks Ihar","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3f4b51a404896f1e07351a07df8553c64e7fb24e","unresolved":false,"context_lines":[{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("},{"line_number":462,"context_line":"                    v6_nets[fip.subnet_id].ipv6_address_mode \u003d\u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_011f7608","line":459,"updated":"2015-06-18 11:32:54.000000000","message":"this is a nit, but if you need to resubmit, I\u0027d refactor this to a separate function _sort_fixed_ips_for_dnsmasq ? \n\nAnd use the big comment as part of the docstring.","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d885747e2d39cbafe708a5723bf2f05f0d54d9c8","unresolved":false,"context_lines":[{"line_number":456,"context_line":"            # dnsmasq uses this entry(as dnsmasq reads the hosts file from EOF)"},{"line_number":457,"context_line":"            # to resolve IPv4 and IPv6 stateful address requests and"},{"line_number":458,"context_line":"            # returns no address."},{"line_number":459,"context_line":"            fixed_ips \u003d sorted("},{"line_number":460,"context_line":"                port.fixed_ips,"},{"line_number":461,"context_line":"                key\u003dlambda fip: ((fip.subnet_id in v6_nets) and ("},{"line_number":462,"context_line":"                    v6_nets[fip.subnet_id].ipv6_address_mode \u003d\u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_1f3baaec","line":459,"in_reply_to":"fa32b979_011f7608","updated":"2015-06-23 11:24:49.000000000","message":"Yeah, a big comment saying that we rely on internal details of dnsmasq, with a link to the email thread in dnsmasq-discuss@ maybe. It\u0027s really fragile, so I would leave as much clue to those who will eventually be broken by dnsmasq refactoring in the future.","commit_id":"548812a84aa6780296042bf81205a2fce67b56fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"87f794ac2fe1dd694b487a600df080ca8df5fd3e","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        self.device_manager.update(self.network, self.interface_name)"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"    def _sort_fixed_ips_for_dnsmasq(self, fixed_ips, v6_nets):"},{"line_number":438,"context_line":"        \"\"\"Sort fixed_ips so that stateless IPv6 subnets appear first."},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        For example, If a port with v6 extra_dhcp_opts is on a network with"},{"line_number":441,"context_line":"        IPv4 and IPv6 stateless subnets. Then dhcp host file will have"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_2bfde2b0","line":438,"updated":"2015-06-24 08:06:17.000000000","message":"That comment is very detailed. Kudos from people of the future who will fix it after dnsmasq people break the assumption!","commit_id":"481d9a4f356d325e60e4c208c93693d755097bcd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"87f794ac2fe1dd694b487a600df080ca8df5fd3e","unresolved":false,"context_lines":[{"line_number":452,"context_line":"           fa:16:3e:8f:9d:65,set:aabc7d33-4874-429e-9637-436e4232d2cd"},{"line_number":453,"context_line":"        3) But dnsmasq doesn\u0027t have sufficient checks to skip this entry and"},{"line_number":454,"context_line":"           pick next entry, to process dhcp IPv4 request."},{"line_number":455,"context_line":"        4) So dnsmaq uses this this entry to process dhcp IPv4 request."},{"line_number":456,"context_line":"        5) As there is no ip in this entry, dnsmaq logs \"no address available\""},{"line_number":457,"context_line":"           and fails to send DHCPOFFER message."},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_ab59f2fe","line":455,"updated":"2015-06-24 08:06:17.000000000","message":"dnsmaq -\u003e dnsmasq; this this -\u003e this","commit_id":"481d9a4f356d325e60e4c208c93693d755097bcd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"87f794ac2fe1dd694b487a600df080ca8df5fd3e","unresolved":false,"context_lines":[{"line_number":453,"context_line":"        3) But dnsmasq doesn\u0027t have sufficient checks to skip this entry and"},{"line_number":454,"context_line":"           pick next entry, to process dhcp IPv4 request."},{"line_number":455,"context_line":"        4) So dnsmaq uses this this entry to process dhcp IPv4 request."},{"line_number":456,"context_line":"        5) As there is no ip in this entry, dnsmaq logs \"no address available\""},{"line_number":457,"context_line":"           and fails to send DHCPOFFER message."},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        As we rely on internal details of dnsmasq to understand and fix the"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_6b70ca72","line":456,"updated":"2015-06-24 08:06:17.000000000","message":"dnsmaq -\u003e dnsmasq","commit_id":"481d9a4f356d325e60e4c208c93693d755097bcd"}],"neutron/tests/unit/agent/linux/test_dhcp.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":934,"context_line":"            cmd_callback \u003d call_kwargs[\u0027default_cmd_callback\u0027]"},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"            result_cmd \u003d cmd_callback(expected_pid_file)"},{"line_number":937,"context_line":""},{"line_number":938,"context_line":"            self.assertEqual(expected, result_cmd)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"    def test_spawn(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_744a4985","side":"PARENT","line":937,"updated":"2015-06-05 21:30:45.000000000","message":"Please add this line back in.  This is just asking for merge conflicts.","commit_id":"7a8bdf7fe21cacc919343b50db4cd154de1a713e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bfdbeac6c64cf99ace6d2bbd6ccba1caa556a0d2","unresolved":false,"context_lines":[{"line_number":936,"context_line":"            call_kwargs \u003d self.external_process.mock_calls[0][2]"},{"line_number":937,"context_line":"            cmd_callback \u003d call_kwargs[\u0027default_cmd_callback\u0027]"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"            result_cmd \u003d cmd_callback(expected_pid_file)"},{"line_number":940,"context_line":"            self.assertEqual(expected, result_cmd)"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"    def test_spawn(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_9ded9ef1","line":939,"updated":"2015-06-09 04:45:06.000000000","message":"See comment to the left.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":952,"context_line":"        self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])"},{"line_number":953,"context_line":""},{"line_number":954,"context_line":"    def test_spawn_no_dhcp_domain(self):"},{"line_number":955,"context_line":"        (exp_host_name, host_data, exp_host_data, exp_addn_name, addn_data,"},{"line_number":956,"context_line":"         exp_addn_data) \u003d self._test_no_dhcp_domain_alloc_data"},{"line_number":957,"context_line":"        self.conf.set_override(\u0027dhcp_domain\u0027, \u0027\u0027)"},{"line_number":958,"context_line":"        self._test_spawn([\u0027--conf-file\u003d\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_fa74e3fd","line":955,"updated":"2015-06-05 21:30:45.000000000","message":"I think most of the changes in this test file have to do with the sorting change.  I don\u0027t see anything to exercise the other change in this patch set.  I would expect to see more data with \"set:\" in it.  Or, at least changes to the UTs that do have \"set:\" but I don\u0027t see anything like that.\n\nI can only conclude that your change is not tested.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"bfdbeac6c64cf99ace6d2bbd6ccba1caa556a0d2","unresolved":false,"context_lines":[{"line_number":952,"context_line":"        self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])"},{"line_number":953,"context_line":""},{"line_number":954,"context_line":"    def test_spawn_no_dhcp_domain(self):"},{"line_number":955,"context_line":"        (exp_host_name, host_data, exp_host_data, exp_addn_name, addn_data,"},{"line_number":956,"context_line":"         exp_addn_data) \u003d self._test_no_dhcp_domain_alloc_data"},{"line_number":957,"context_line":"        self.conf.set_override(\u0027dhcp_domain\u0027, \u0027\u0027)"},{"line_number":958,"context_line":"        self._test_spawn([\u0027--conf-file\u003d\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_7d38a2a0","line":955,"in_reply_to":"3afb71cf_a1d51b44","updated":"2015-06-09 04:45:06.000000000","message":"Which UT exposes the problem with _read_hosts_file_leases that you found?  If they passed before your fix then how will it prevent a regression?","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"07e193fbe6332abed0ee7836c938942163bd17bf","unresolved":false,"context_lines":[{"line_number":952,"context_line":"        self._test_spawn([\u0027--conf-file\u003d/foo\u0027, \u0027--domain\u003dopenstacklocal\u0027])"},{"line_number":953,"context_line":""},{"line_number":954,"context_line":"    def test_spawn_no_dhcp_domain(self):"},{"line_number":955,"context_line":"        (exp_host_name, host_data, exp_host_data, exp_addn_name, addn_data,"},{"line_number":956,"context_line":"         exp_addn_data) \u003d self._test_no_dhcp_domain_alloc_data"},{"line_number":957,"context_line":"        self.conf.set_override(\u0027dhcp_domain\u0027, \u0027\u0027)"},{"line_number":958,"context_line":"        self._test_spawn([\u0027--conf-file\u003d\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_a1d51b44","line":955,"in_reply_to":"3afb71cf_fa74e3fd","updated":"2015-06-06 07:22:27.000000000","message":"Already unit tests for stateless IPV6 with extra_dhcp_opts exists. So i didn\u0027t add new one.","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":1586,"context_line":"                         \u0027192.168.0.5\\n\u0027"},{"line_number":1587,"context_line":"                         \u002700:00:0f:aa:bb:66,id:test6,\u0027"},{"line_number":1588,"context_line":"                         \u0027host-192-168-0-6.openstacklocal,192.168.0.6,\u0027"},{"line_number":1589,"context_line":"                         \u0027set:ccccccccc-cccc-cccc-cccc-ccccccccc\\n\u0027).lstrip()"},{"line_number":1590,"context_line":""},{"line_number":1591,"context_line":"        dm \u003d self._get_dnsmasq(FakeV4NetworkClientId)"},{"line_number":1592,"context_line":"        dm._output_hosts_file()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_1af33fa0","line":1589,"updated":"2015-06-05 21:30:45.000000000","message":"set:","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1f3faf9e444680d67e3281dc819b0d70e8f6e6ec","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"    def test_host_and_opts_file_on_stateless_dhcpv6_network(self):"},{"line_number":1612,"context_line":"        exp_host_name \u003d \u0027/dhcp/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/host\u0027"},{"line_number":1613,"context_line":"        exp_host_data \u003d (\u002700:16:3e:c2:77:1d,\u0027"},{"line_number":1614,"context_line":"                         \u0027set:hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\\n\u0027).lstrip()"},{"line_number":1615,"context_line":"        exp_opt_name \u003d \u0027/dhcp/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/opts\u0027"},{"line_number":1616,"context_line":"        exp_opt_data \u003d (\u0027tag:tag0,option6:domain-search,openstacklocal\\n\u0027"},{"line_number":1617,"context_line":"                        \u0027tag:hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh,\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_faef43ae","line":1614,"updated":"2015-06-05 21:30:45.000000000","message":"set:","commit_id":"977031449add4a8448257601ec48015d71d0b3fc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e22715fe597376270d62fc85e0ba4b05162e9da2","unresolved":false,"context_lines":[{"line_number":934,"context_line":"            cmd_callback \u003d call_kwargs[\u0027default_cmd_callback\u0027]"},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"            result_cmd \u003d cmd_callback(expected_pid_file)"},{"line_number":937,"context_line":""},{"line_number":938,"context_line":"            self.assertEqual(expected, result_cmd)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"    def test_spawn(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_ef3e78d9","side":"PARENT","line":937,"updated":"2015-06-16 07:52:27.000000000","message":"nit: please avoid irrelevant changes, it may complicate backport a bit.","commit_id":"7a8bdf7fe21cacc919343b50db4cd154de1a713e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e22715fe597376270d62fc85e0ba4b05162e9da2","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.ip_address \u003d address"},{"line_number":39,"context_line":"        self.subnet_id \u003d subnet_id"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def __getitem__(self, key):"},{"line_number":42,"context_line":"        return self.ip_address if key is \u0027ip_address\u0027 else self.subnet_id"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_d241db0c","line":41,"updated":"2015-06-16 07:52:27.000000000","message":"Please clarify why it\u0027s here. I fail to understand its relation to the change.","commit_id":"2b66e787c26760084780240711465e7ddcf12b6f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e22715fe597376270d62fc85e0ba4b05162e9da2","unresolved":false,"context_lines":[{"line_number":1293,"context_line":"            \u0027host-192-168-0-1 \u0027"},{"line_number":1294,"context_line":"            \u0027host-192-168-0-1\\n\u0027"},{"line_number":1295,"context_line":"        ).lstrip()"},{"line_number":1296,"context_line":"        return (exp_host_name, host_data, exp_host_data,"},{"line_number":1297,"context_line":"                exp_addn_name, addn_data, exp_addn_data)"},{"line_number":1298,"context_line":""},{"line_number":1299,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_92c5938f","line":1296,"updated":"2015-06-16 07:52:27.000000000","message":"Not sure I follow where those new returned values are used at all. Are they?","commit_id":"2b66e787c26760084780240711465e7ddcf12b6f"}]}
