)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"f7d91ee2da8da82bb2d2fae8e47e0ef8762a9c63","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add the DHCPReponder for IPv6"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch implements the responder for DHCPv6. Same to"},{"line_number":10,"context_line":"the IPv4, this is to assemble the DHCPv6 packet with"},{"line_number":11,"context_line":"its related options based on the information of"},{"line_number":12,"context_line":"neutron Port/Subnet/Network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"56d6df88_236dc6a0","line":9,"range":{"start_line":9,"start_character":53,"end_line":9,"end_character":55},"updated":"2021-05-13 15:37:10.000000000","message":"nit: as?","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"546aa9ac76d288a491e2410956070fe9df25483b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add the DHCPReponder for IPv6"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch implements the responder for DHCPv6. Same to"},{"line_number":10,"context_line":"the IPv4, this is to assemble the DHCPv6 packet with"},{"line_number":11,"context_line":"its related options based on the information of"},{"line_number":12,"context_line":"neutron Port/Subnet/Network."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"b9f89633_2f95b222","line":9,"range":{"start_line":9,"start_character":53,"end_line":9,"end_character":55},"in_reply_to":"56d6df88_236dc6a0","updated":"2021-05-14 02:06:29.000000000","message":"Done","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"}],"neutron/agent/l2/extensions/dhcp/ipv6.py":[{"author":{"_account_id":25058,"name":"huangshan","email":"huangshan@fiberhome.com","username":"huangshan"},"change_message_id":"1cf2df67f6b218576a5e8019105a9e5e20f1eaf1","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":86,"context_line":"        return status_code + message_bin"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def _get_req_t1(self, options):"},{"line_number":89,"context_line":"        for opt in options:"},{"line_number":90,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":91,"context_line":"                return opt.data[4:8]"},{"line_number":92,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _get_req_t2(self, options):"},{"line_number":95,"context_line":"        for opt in options:"},{"line_number":96,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":97,"context_line":"                return opt.data[8:12]"},{"line_number":98,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":101,"context_line":"        for opt in options:"},{"line_number":102,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":103,"context_line":"                return opt.data[-8:-4]"},{"line_number":104,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":107,"context_line":"        for opt in options:"},{"line_number":108,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":109,"context_line":"                return opt.data[-4:]"},{"line_number":110,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":113,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9048af08_4774db90","line":110,"range":{"start_line":88,"start_character":0,"end_line":110,"end_character":62},"updated":"2021-02-25 06:15:22.000000000","message":"In windows virtual machine,\nThe value of T1 and T2 in the dhcpv6 solicat packet is 0,\nWill cause no lease time available and IP configuration failure","commit_id":"a6d2c3df7b67eba502b03dfc3cd5b8c73537e729"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"f14f59f4b3d30792d8d1e3068b70bbb2970c9041","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":86,"context_line":"        return status_code + message_bin"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def _get_req_t1(self, options):"},{"line_number":89,"context_line":"        for opt in options:"},{"line_number":90,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":91,"context_line":"                return opt.data[4:8]"},{"line_number":92,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _get_req_t2(self, options):"},{"line_number":95,"context_line":"        for opt in options:"},{"line_number":96,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":97,"context_line":"                return opt.data[8:12]"},{"line_number":98,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":101,"context_line":"        for opt in options:"},{"line_number":102,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":103,"context_line":"                return opt.data[-8:-4]"},{"line_number":104,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":107,"context_line":"        for opt in options:"},{"line_number":108,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":109,"context_line":"                return opt.data[-4:]"},{"line_number":110,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":113,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"d95c99b9_3b59f0c5","line":110,"range":{"start_line":88,"start_character":0,"end_line":110,"end_character":62},"in_reply_to":"9048af08_4774db90","updated":"2021-02-25 07:58:51.000000000","message":"Great, and thank you very much, I will verify and test this.","commit_id":"a6d2c3df7b67eba502b03dfc3cd5b8c73537e729"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"aad62a0dea3c3ff258e4ab11414de747e582355f","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":86,"context_line":"        return status_code + message_bin"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def _get_req_t1(self, options):"},{"line_number":89,"context_line":"        for opt in options:"},{"line_number":90,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":91,"context_line":"                return opt.data[4:8]"},{"line_number":92,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _get_req_t2(self, options):"},{"line_number":95,"context_line":"        for opt in options:"},{"line_number":96,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":97,"context_line":"                return opt.data[8:12]"},{"line_number":98,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":101,"context_line":"        for opt in options:"},{"line_number":102,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":103,"context_line":"                return opt.data[-8:-4]"},{"line_number":104,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":107,"context_line":"        for opt in options:"},{"line_number":108,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":109,"context_line":"                return opt.data[-4:]"},{"line_number":110,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":113,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"286fd7a8_9d2a0663","line":110,"range":{"start_line":88,"start_character":0,"end_line":110,"end_character":62},"in_reply_to":"d95c99b9_3b59f0c5","updated":"2021-03-05 10:08:12.000000000","message":"Done, fixed by checking the value of the option.","commit_id":"a6d2c3df7b67eba502b03dfc3cd5b8c73537e729"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"39592907b707863e906f80c6be8dd700a3698448","unresolved":true,"context_lines":[{"line_number":107,"context_line":"        for opt in options:"},{"line_number":108,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":109,"context_line":"                return opt.data[-4:]"},{"line_number":110,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":113,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f03a643_171f4033","line":110,"updated":"2021-03-05 08:22:35.000000000","message":"all those methods in L88-L110 are iterating through the same list of options but looking for different one, maybe You could do something smarter, e.g.\n\n    def _ger_req_options(self, options):\n        req_opts \u003d {\n            \u0027t1\u0027: struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration),\n            \u0027t2\u0027: struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration),\n            \u0027prefered_lifetime\u0027: struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration),\n            \u0027valid_lifetime\u0027: struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)\n        }\n        for opt in options:\n             if opt.code \u003d\u003d  dhcp6.DHCPV6_OPTION_IA_NA:\n                  req_opts[\u0027t1\u0027] \u003d opt.data[4:8]\n                  req_opts[\u0027t2\u0027] \u003d opt.data[8:12]\n                  req_opts[\u0027prefered_lifetime\u0027] \u003d opt.data[-8:-4]\n                  req_opts[\u0027valid_lifetime\u0027] \u003d opt.data[-4:]\n                  break\n        return req_opts","commit_id":"6cf80301654a5fcd97b011333972709b65ab6bb9"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"39592907b707863e906f80c6be8dd700a3698448","unresolved":true,"context_lines":[{"line_number":221,"context_line":"        for opt in options:"},{"line_number":222,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":223,"context_line":"                return opt.data[:4]"},{"line_number":224,"context_line":"        return struct.pack(\u0027!I\u0027, 1)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def get_ret_type(self, req_type):"},{"line_number":227,"context_line":"        if req_type \u003d\u003d \u0027SOLICIT\u0027:"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf21b4a7_bcdf30cd","line":224,"updated":"2021-03-05 08:22:35.000000000","message":"and this one could be also included maybe in that method which I proposed above","commit_id":"6cf80301654a5fcd97b011333972709b65ab6bb9"},{"author":{"_account_id":25058,"name":"huangshan","email":"huangshan@fiberhome.com","username":"huangshan"},"change_message_id":"7f543e2e9d99f3c137e899b689ef5b013e99dc41","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        # Hardware type: Ethernet (1)"},{"line_number":73,"context_line":"        hardware_type \u003d struct.pack(\u0027!H\u0027, 1)"},{"line_number":74,"context_line":"        # DUID Time: time now"},{"line_number":75,"context_line":"        duid_time \u003d struct.pack(\u0027!I\u0027, int(time.time()))"},{"line_number":76,"context_line":"        # Link-layer address: Server MAC"},{"line_number":77,"context_line":"        mac_bin \u003d addrconv.mac.text_to_bin(str(self.hw_addr))"},{"line_number":78,"context_line":"        return l2_plus_time + hardware_type + duid_time + mac_bin"}],"source_content_type":"text/x-python","patch_set":9,"id":"4edc9c29_0e2e63ae","line":75,"range":{"start_line":75,"start_character":0,"end_line":75,"end_character":55},"updated":"2021-03-08 03:23:48.000000000","message":"The packet capture found that the duid time year is 2051. This will cause the windows system to fail to obtain the IP address","commit_id":"072290c38396b0f3b2edc68cee17426b71617021"},{"author":{"_account_id":25058,"name":"huangshan","email":"huangshan@fiberhome.com","username":"huangshan"},"change_message_id":"de8528eed32b7c7a04c8c90f1521b49c06b5e7ad","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        # Hardware type: Ethernet (1)"},{"line_number":73,"context_line":"        hardware_type \u003d struct.pack(\u0027!H\u0027, 1)"},{"line_number":74,"context_line":"        # DUID Time: time now"},{"line_number":75,"context_line":"        duid_time \u003d struct.pack(\u0027!I\u0027, int(time.time()))"},{"line_number":76,"context_line":"        # Link-layer address: Server MAC"},{"line_number":77,"context_line":"        mac_bin \u003d addrconv.mac.text_to_bin(str(self.hw_addr))"},{"line_number":78,"context_line":"        return l2_plus_time + hardware_type + duid_time + mac_bin"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ecef766_03fd93f2","line":75,"range":{"start_line":75,"start_character":0,"end_line":75,"end_character":55},"in_reply_to":"34f4b490_06e6f4e0","updated":"2021-03-09 06:32:10.000000000","message":"win7 and windows server 2008 R2","commit_id":"072290c38396b0f3b2edc68cee17426b71617021"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"bf9ff697ec03785fb857668c82edbff20d941d1a","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        # Hardware type: Ethernet (1)"},{"line_number":73,"context_line":"        hardware_type \u003d struct.pack(\u0027!H\u0027, 1)"},{"line_number":74,"context_line":"        # DUID Time: time now"},{"line_number":75,"context_line":"        duid_time \u003d struct.pack(\u0027!I\u0027, int(time.time()))"},{"line_number":76,"context_line":"        # Link-layer address: Server MAC"},{"line_number":77,"context_line":"        mac_bin \u003d addrconv.mac.text_to_bin(str(self.hw_addr))"},{"line_number":78,"context_line":"        return l2_plus_time + hardware_type + duid_time + mac_bin"}],"source_content_type":"text/x-python","patch_set":9,"id":"34f4b490_06e6f4e0","line":75,"range":{"start_line":75,"start_character":0,"end_line":75,"end_character":55},"in_reply_to":"4edc9c29_0e2e63ae","updated":"2021-03-08 04:38:35.000000000","message":"May I have the windows version?","commit_id":"072290c38396b0f3b2edc68cee17426b71617021"},{"author":{"_account_id":25058,"name":"huangshan","email":"huangshan@fiberhome.com","username":"huangshan"},"change_message_id":"7f543e2e9d99f3c137e899b689ef5b013e99dc41","unresolved":true,"context_lines":[{"line_number":140,"context_line":"                data\u003dclient_ident,"},{"line_number":141,"context_line":"                length\u003dlen(client_ident)))"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        self.get_dhcpv6_server_ident()"},{"line_number":144,"context_line":"        server_id_bin \u003d self.get_dhcpv6_server_ident()"},{"line_number":145,"context_line":"        option_list.append("},{"line_number":146,"context_line":"            dhcp6.option("}],"source_content_type":"text/x-python","patch_set":9,"id":"d4f518e7_d1a95bea","line":143,"range":{"start_line":143,"start_character":0,"end_line":143,"end_character":38},"updated":"2021-03-08 03:23:48.000000000","message":"Replace 144?","commit_id":"072290c38396b0f3b2edc68cee17426b71617021"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c31abd76dd55bd0281dbec83b2f946363a10ab3d","unresolved":true,"context_lines":[{"line_number":140,"context_line":"                data\u003dclient_ident,"},{"line_number":141,"context_line":"                length\u003dlen(client_ident)))"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        self.get_dhcpv6_server_ident()"},{"line_number":144,"context_line":"        server_id_bin \u003d self.get_dhcpv6_server_ident()"},{"line_number":145,"context_line":"        option_list.append("},{"line_number":146,"context_line":"            dhcp6.option("}],"source_content_type":"text/x-python","patch_set":9,"id":"732322a3_cbcc86c2","line":143,"range":{"start_line":143,"start_character":0,"end_line":143,"end_character":38},"in_reply_to":"d4f518e7_d1a95bea","updated":"2021-03-15 02:24:17.000000000","message":"It\u0027s redundant. Removed.","commit_id":"072290c38396b0f3b2edc68cee17426b71617021"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"41ad1a9f5c5be51b848842422fd2eca33532a1fb","unresolved":true,"context_lines":[{"line_number":128,"context_line":"                return opt.data[:4]"},{"line_number":129,"context_line":"        return struct.pack(\u0027!I\u0027, 1)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":132,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"},{"line_number":133,"context_line":"        gateway_ip \u003d ip_info[\u0027gateway_ip\u0027]"},{"line_number":134,"context_line":"        dns_nameservers \u003d ip_info[\u0027dns_nameservers\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"f6b7169c_81ceadc5","line":131,"range":{"start_line":131,"start_character":4,"end_line":131,"end_character":68},"updated":"2021-03-12 11:42:09.000000000","message":"Could you break this into smaller chunks","commit_id":"0381522b628c08484a21c753c4e39574d28d74c5"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"931e625d48e122e97a6ea57606205adaed87f046","unresolved":true,"context_lines":[{"line_number":128,"context_line":"                return opt.data[:4]"},{"line_number":129,"context_line":"        return struct.pack(\u0027!I\u0027, 1)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def get_dhcp_options(self, mac, ip_info, req_options, req_type):"},{"line_number":132,"context_line":"        ip_addr \u003d ip_info[\u0027ip_address\u0027]"},{"line_number":133,"context_line":"        gateway_ip \u003d ip_info[\u0027gateway_ip\u0027]"},{"line_number":134,"context_line":"        dns_nameservers \u003d ip_info[\u0027dns_nameservers\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"905ac79b_be1a95a4","line":131,"range":{"start_line":131,"start_character":4,"end_line":131,"end_character":68},"in_reply_to":"f6b7169c_81ceadc5","updated":"2021-03-15 02:37:58.000000000","message":"Move OPTION_IA_NA to a new function.","commit_id":"0381522b628c08484a21c753c4e39574d28d74c5"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"f7d91ee2da8da82bb2d2fae8e47e0ef8762a9c63","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":20,"id":"50cf2c16_4fd59030","updated":"2021-05-13 15:37:10.000000000","message":"General comment: could you add some doscstring or comment to describe the methods here to make debugging/understanding easier?\n_get_req_t1 and similar method names are not easy to read, so short explanation would be useful","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"546aa9ac76d288a491e2410956070fe9df25483b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":20,"id":"f81e7395_a05948d7","in_reply_to":"50cf2c16_4fd59030","updated":"2021-05-14 02:06:29.000000000","message":"Sure, I will add some. These are the names of IA_NA (Identity Association for Non-temporary Addresses) from the defination of RFC 8415 [1], so I thought it is common and self-explained. 😊\n\n[1] https://datatracker.ietf.org/doc/html/rfc8415","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"b313b02c2f8ba277b83eafd54736c1f999dc739c","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":20,"id":"2ffc119f_1821921f","in_reply_to":"f81e7395_a05948d7","updated":"2021-05-14 09:29:01.000000000","message":"perhaps a reference to the related rfc section is enough.\nThanks","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":63,"context_line":"                                                version\u003ddhcp_base.IPV6_STR,"},{"line_number":64,"context_line":"                                                *args, **kwargs)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def _create_duid(self, mac):"},{"line_number":67,"context_line":"        duid_type \u003d struct.pack(\u0027!H\u0027, DUID_TYPE_LINK_LAYER_ADDRESS_PLUS_TIME)"},{"line_number":68,"context_line":"        hardware_type \u003d struct.pack(\u0027!H\u0027, HARDWARE_TYPE_ETHERNET)"},{"line_number":69,"context_line":"        # DUID Time: time now"}],"source_content_type":"text/x-python","patch_set":21,"id":"8f872c1d_32ca4be1","line":66,"updated":"2021-05-18 20:09:53.000000000","message":"this method seems \"mysterious\" for me :) Can You maybe add some short comment with description what it is actually doing?","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e4e6cb970dc630975a5aeec34c29510a8090c4b5","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                                version\u003ddhcp_base.IPV6_STR,"},{"line_number":64,"context_line":"                                                *args, **kwargs)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def _create_duid(self, mac):"},{"line_number":67,"context_line":"        duid_type \u003d struct.pack(\u0027!H\u0027, DUID_TYPE_LINK_LAYER_ADDRESS_PLUS_TIME)"},{"line_number":68,"context_line":"        hardware_type \u003d struct.pack(\u0027!H\u0027, HARDWARE_TYPE_ETHERNET)"},{"line_number":69,"context_line":"        # DUID Time: time now"}],"source_content_type":"text/x-python","patch_set":21,"id":"8aff8d05_11f0e926","line":66,"in_reply_to":"8f872c1d_32ca4be1","updated":"2021-05-20 03:16:47.000000000","message":"Done","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":103,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":104,"context_line":"                    break"},{"line_number":105,"context_line":"                return opt.data[4:8]"},{"line_number":106,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _get_req_t2(self, options):"},{"line_number":109,"context_line":"        \"\"\"Get request time interval T2 option for IA_NA."}],"source_content_type":"text/x-python","patch_set":21,"id":"23f86693_cd5a75ec","line":106,"updated":"2021-05-18 20:09:53.000000000","message":"nit: You can return this directly in L104, no?","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":117,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":118,"context_line":"                    break"},{"line_number":119,"context_line":"                return opt.data[8:12]"},{"line_number":120,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":123,"context_line":"        \"\"\"Get request Preferred Lifetime for IA_NA."}],"source_content_type":"text/x-python","patch_set":21,"id":"7d80633c_d680883c","line":120,"updated":"2021-05-18 20:09:53.000000000","message":"same here","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":152,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":153,"context_line":"                    break"},{"line_number":154,"context_line":"                return opt.data[-4:]"},{"line_number":155,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _get_ia_id(self, options):"},{"line_number":158,"context_line":"        \"\"\"Get request IAID for IA_NA."}],"source_content_type":"text/x-python","patch_set":21,"id":"ac679bbd_f33bcadd","line":155,"updated":"2021-05-18 20:09:53.000000000","message":"and same here","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":269,"context_line":"        # 0000 0... \u003d Reserved: 0x00"},{"line_number":270,"context_line":"        # .... .0.. \u003d N bit: Server should perform DNS updates"},{"line_number":271,"context_line":"        # .... ..1. \u003d O bit: Server has overridden client\u0027s S bit preference"},{"line_number":272,"context_line":"        # .... ...1 \u003d S bit: Server should perform forward DNS updates"},{"line_number":273,"context_line":"        dns_tag \u003d struct.pack(\u0027!b\u0027, 3)"},{"line_number":274,"context_line":"        # Client FQDN: host-\u003cip-v6-address\u003e"},{"line_number":275,"context_line":"        fqdn_bin \u003d struct.pack(\u0027!%ds\u0027 % len(fqdn), bytes(str(fqdn).encode()))"}],"source_content_type":"text/x-python","patch_set":21,"id":"cbd4ab31_a7505a50","line":272,"updated":"2021-05-18 20:09:53.000000000","message":"nice description, thx :)","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":286,"context_line":"    def get_ret_type(self, req_type):"},{"line_number":287,"context_line":"        if req_type \u003d\u003d \u0027SOLICIT\u0027:"},{"line_number":288,"context_line":"            return dhcp6.DHCPV6_ADVERTISE"},{"line_number":289,"context_line":"        elif req_type in [\u0027REQUEST\u0027, \u0027CONFIRM\u0027, \u0027RELEASE\u0027, \u0027RENEW\u0027, \u0027REBIND\u0027]:"},{"line_number":290,"context_line":"            return dhcp6.DHCPV6_REPLY"},{"line_number":291,"context_line":"        return -1"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"2339fdde_7c917e7a","line":289,"range":{"start_line":289,"start_character":26,"end_line":289,"end_character":76},"updated":"2021-05-18 20:09:53.000000000","message":"maybe those request types should be defined as constants?","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e4e6cb970dc630975a5aeec34c29510a8090c4b5","unresolved":true,"context_lines":[{"line_number":286,"context_line":"    def get_ret_type(self, req_type):"},{"line_number":287,"context_line":"        if req_type \u003d\u003d \u0027SOLICIT\u0027:"},{"line_number":288,"context_line":"            return dhcp6.DHCPV6_ADVERTISE"},{"line_number":289,"context_line":"        elif req_type in [\u0027REQUEST\u0027, \u0027CONFIRM\u0027, \u0027RELEASE\u0027, \u0027RENEW\u0027, \u0027REBIND\u0027]:"},{"line_number":290,"context_line":"            return dhcp6.DHCPV6_REPLY"},{"line_number":291,"context_line":"        return -1"},{"line_number":292,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"cdfd45d6_fa94099e","line":289,"range":{"start_line":289,"start_character":26,"end_line":289,"end_character":76},"in_reply_to":"2339fdde_7c917e7a","updated":"2021-05-20 03:16:47.000000000","message":"It\u0027s not reused more than 1 time. But, a constant list should be fine.","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":288,"context_line":"            return dhcp6.DHCPV6_ADVERTISE"},{"line_number":289,"context_line":"        elif req_type in [\u0027REQUEST\u0027, \u0027CONFIRM\u0027, \u0027RELEASE\u0027, \u0027RENEW\u0027, \u0027REBIND\u0027]:"},{"line_number":290,"context_line":"            return dhcp6.DHCPV6_REPLY"},{"line_number":291,"context_line":"        return -1"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def get_ret_packet(self, packet_in, port_info, req_type):"},{"line_number":294,"context_line":"        ip_info \u003d self.get_port_ip(port_info,"}],"source_content_type":"text/x-python","patch_set":21,"id":"43c769ab_36790143","line":291,"range":{"start_line":291,"start_character":15,"end_line":291,"end_character":17},"updated":"2021-05-18 20:09:53.000000000","message":"is this some specific value? Maybe should be defined as constant?","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e4e6cb970dc630975a5aeec34c29510a8090c4b5","unresolved":true,"context_lines":[{"line_number":288,"context_line":"            return dhcp6.DHCPV6_ADVERTISE"},{"line_number":289,"context_line":"        elif req_type in [\u0027REQUEST\u0027, \u0027CONFIRM\u0027, \u0027RELEASE\u0027, \u0027RENEW\u0027, \u0027REBIND\u0027]:"},{"line_number":290,"context_line":"            return dhcp6.DHCPV6_REPLY"},{"line_number":291,"context_line":"        return -1"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def get_ret_packet(self, packet_in, port_info, req_type):"},{"line_number":294,"context_line":"        ip_info \u003d self.get_port_ip(port_info,"}],"source_content_type":"text/x-python","patch_set":21,"id":"f4cf45e4_97a611bb","line":291,"range":{"start_line":291,"start_character":15,"end_line":291,"end_character":17},"in_reply_to":"43c769ab_36790143","updated":"2021-05-20 03:16:47.000000000","message":"Align the value of integer for the reply. A constant should be fine.","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":369,"context_line":"        pkt_dhcp \u003d pkt.get_protocol(dhcp6.dhcp6)"},{"line_number":370,"context_line":"        dhcp_req_state \u003d DHCPV6_TYPE_MAP.get(pkt_dhcp.msg_type)"},{"line_number":371,"context_line":"        if not dhcp_req_state:"},{"line_number":372,"context_line":"            LOG.warning(\"DHCP controller received DHCPv6 with unkown \""},{"line_number":373,"context_line":"                        \"type: %s from port: %s\","},{"line_number":374,"context_line":"                        pkt_dhcp.msg_type, ofport)"},{"line_number":375,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":21,"id":"3723dab2_f9de4a04","line":372,"range":{"start_line":372,"start_character":62,"end_line":372,"end_character":68},"updated":"2021-05-18 20:09:53.000000000","message":"nit: typo, should be unknown","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":40,"context_line":"                   dhcp6.DHCPV6_REBIND: \u0027REBIND\u0027}"},{"line_number":41,"context_line":"REQ_TYPES_FOR_REPLY \u003d [\u0027REQUEST\u0027, \u0027CONFIRM\u0027, \u0027RELEASE\u0027, \u0027RENEW\u0027, \u0027REBIND\u0027]"},{"line_number":42,"context_line":"REQ_TYPE_UNKNOWN \u003d -1"},{"line_number":43,"context_line":"# DUID Type:"},{"line_number":44,"context_line":"#    link-layer address (3)"},{"line_number":45,"context_line":"#    link-layer address plus time (1)"},{"line_number":46,"context_line":"DUID_TYPE_LINK_LAYER_ADDRESS \u003d 3"},{"line_number":47,"context_line":"DUID_TYPE_LINK_LAYER_ADDRESS_PLUS_TIME \u003d 1"},{"line_number":48,"context_line":"# Hardware type: Ethernet (1)"}],"source_content_type":"text/x-python","patch_set":22,"id":"42909485_64eca045","line":45,"range":{"start_line":43,"start_character":0,"end_line":45,"end_character":37},"updated":"2021-05-20 09:01:26.000000000","message":"comments seems redundant, here and below","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":65,"context_line":"                                                version\u003ddhcp_base.IPV6_STR,"},{"line_number":66,"context_line":"                                                *args, **kwargs)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _create_duid(self, mac):"},{"line_number":69,"context_line":"        \"\"\"Create a DUID based on the mac address and time."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        For details see RFC 8415:"}],"source_content_type":"text/x-python","patch_set":22,"id":"0b0eff26_95d9cd7a","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":20},"updated":"2021-05-20 09:01:26.000000000","message":"nit: consider class/staticmethod","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":81,"context_line":"        mac_bin \u003d addrconv.mac.text_to_bin(str(mac))"},{"line_number":82,"context_line":"        return duid_type + hardware_type + duid_time + mac_bin"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def get_dhcpv6_client_ident(self, mac, req_options):"},{"line_number":85,"context_line":"        # DHCPV6_OPTION_CLIENTID \u003d 1"},{"line_number":86,"context_line":"        for opt in req_options:"},{"line_number":87,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_CLIENTID:"}],"source_content_type":"text/x-python","patch_set":22,"id":"8af72e5d_8597530e","line":84,"range":{"start_line":84,"start_character":4,"end_line":84,"end_character":31},"updated":"2021-05-20 09:01:26.000000000","message":"ditto and below","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        return duid_type + hardware_type + duid_time + mac_bin"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def get_dhcpv6_client_ident(self, mac, req_options):"},{"line_number":85,"context_line":"        # DHCPV6_OPTION_CLIENTID \u003d 1"},{"line_number":86,"context_line":"        for opt in req_options:"},{"line_number":87,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_CLIENTID:"},{"line_number":88,"context_line":"                return opt.data"}],"source_content_type":"text/x-python","patch_set":22,"id":"38f0d9ab_c13c249d","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":36},"updated":"2021-05-20 09:01:26.000000000","message":"why need this comment?","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"53cb83ace99925a598ea4209ed32ca85c9447625","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        return duid_type + hardware_type + duid_time + mac_bin"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def get_dhcpv6_client_ident(self, mac, req_options):"},{"line_number":85,"context_line":"        # DHCPV6_OPTION_CLIENTID \u003d 1"},{"line_number":86,"context_line":"        for opt in req_options:"},{"line_number":87,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_CLIENTID:"},{"line_number":88,"context_line":"                return opt.data"}],"source_content_type":"text/x-python","patch_set":22,"id":"c6b3f847_b0243ade","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":36},"in_reply_to":"2786d6d0_f032254f","updated":"2021-05-20 09:44:54.000000000","message":"Sorry, not sure I understand how this info could be helpful","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8dcfaba9f9806acdcdde176f6e41a0a0955ba1e2","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        return duid_type + hardware_type + duid_time + mac_bin"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def get_dhcpv6_client_ident(self, mac, req_options):"},{"line_number":85,"context_line":"        # DHCPV6_OPTION_CLIENTID \u003d 1"},{"line_number":86,"context_line":"        for opt in req_options:"},{"line_number":87,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_CLIENTID:"},{"line_number":88,"context_line":"                return opt.data"}],"source_content_type":"text/x-python","patch_set":22,"id":"2786d6d0_f032254f","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":36},"in_reply_to":"38f0d9ab_c13c249d","updated":"2021-05-20 09:36:10.000000000","message":"Mark for option list, see line 225, 233, 242, 257 and so on.","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8ff3eab15a5114fb52ac191199a7da0fd4f9b204","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        return duid_type + hardware_type + duid_time + mac_bin"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def get_dhcpv6_client_ident(self, mac, req_options):"},{"line_number":85,"context_line":"        # DHCPV6_OPTION_CLIENTID \u003d 1"},{"line_number":86,"context_line":"        for opt in req_options:"},{"line_number":87,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_CLIENTID:"},{"line_number":88,"context_line":"                return opt.data"}],"source_content_type":"text/x-python","patch_set":22,"id":"d3263098_f89480d6","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":36},"in_reply_to":"c6b3f847_b0243ade","updated":"2021-05-20 10:02:50.000000000","message":"For us and other neutron developers or reviewers to have quick way to distinguish the option list for DHCPv6 we set.","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":89,"context_line":"        return self._create_duid(mac)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def get_dhcpv6_server_ident(self):"},{"line_number":92,"context_line":"        # DHCPV6_OPTION_SERVERID \u003d 2"},{"line_number":93,"context_line":"        return self._create_duid(self.hw_addr)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def get_dhcpv6_status_code(self, message, code\u003dDHCPV6_STATUS_CODE_SUCCESS):"}],"source_content_type":"text/x-python","patch_set":22,"id":"0a9cbdcb_8fb081ba","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":36},"updated":"2021-05-20 09:01:26.000000000","message":"?","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":93,"context_line":"        return self._create_duid(self.hw_addr)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def get_dhcpv6_status_code(self, message, code\u003dDHCPV6_STATUS_CODE_SUCCESS):"},{"line_number":96,"context_line":"        # DHCPV6_OPTION_STATUS_CODE \u003d 13"},{"line_number":97,"context_line":"        status_code \u003d struct.pack(\u0027!H\u0027, code)"},{"line_number":98,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":99,"context_line":"                                  bytes(str(message).encode()))"}],"source_content_type":"text/x-python","patch_set":22,"id":"ca6110ad_65a197a4","line":96,"range":{"start_line":96,"start_character":8,"end_line":96,"end_character":40},"updated":"2021-05-20 09:01:26.000000000","message":"?","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":100,"context_line":"        return status_code + message_bin"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_req_t1(self, options):"},{"line_number":103,"context_line":"        \"\"\"Get request time interval T1 option for IA_NA."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":106,"context_line":"        use the default value."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        for opt in options:"},{"line_number":109,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":110,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[4:8])"},{"line_number":111,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":112,"context_line":"                    break"},{"line_number":113,"context_line":"                return opt.data[4:8]"},{"line_number":114,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _get_req_t2(self, options):"},{"line_number":117,"context_line":"        \"\"\"Get request time interval T2 option for IA_NA."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":120,"context_line":"        use the default value."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        for opt in options:"},{"line_number":123,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":124,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[8:12])"},{"line_number":125,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"                return opt.data[8:12]"},{"line_number":128,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":131,"context_line":"        \"\"\"Get request Preferred Lifetime for IA_NA."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        The \"Preferred Lifetime\" specifies the number of seconds"},{"line_number":134,"context_line":"        that this prefix is preferred for use when the RA indicates"},{"line_number":135,"context_line":"        that Stateless Address Auto-Configuration (SLAAC) is used."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":138,"context_line":"        use the default value."},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        for opt in options:"},{"line_number":141,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":142,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-8:-4])"},{"line_number":143,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":144,"context_line":"                    break"},{"line_number":145,"context_line":"                return opt.data[-8:-4]"},{"line_number":146,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":149,"context_line":"        \"\"\"Get request Valid Lifetime for IA_NA."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        The \"Valid Lifetime\" specifies the number of seconds"},{"line_number":152,"context_line":"        that this prefix will be used on this network"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":155,"context_line":"        use the default value."},{"line_number":156,"context_line":"        \"\"\""},{"line_number":157,"context_line":"        for opt in options:"},{"line_number":158,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":159,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-4:])"},{"line_number":160,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":161,"context_line":"                    break"},{"line_number":162,"context_line":"                return opt.data[-4:]"},{"line_number":163,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_ia_id(self, options):"},{"line_number":166,"context_line":"        \"\"\"Get request IAID for IA_NA."}],"source_content_type":"text/x-python","patch_set":22,"id":"610e0d27_f3fc680a","line":163,"range":{"start_line":102,"start_character":0,"end_line":163,"end_character":62},"updated":"2021-05-20 09:01:26.000000000","message":"consider refactoring to avoid code/logic duplication.\nOr better just have a single method returning a tuple","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"092d905283a0ed31952178d3bb45cc816d052ab5","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":100,"context_line":"        return status_code + message_bin"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_req_t1(self, options):"},{"line_number":103,"context_line":"        \"\"\"Get request time interval T1 option for IA_NA."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":106,"context_line":"        use the default value."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        for opt in options:"},{"line_number":109,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":110,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[4:8])"},{"line_number":111,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":112,"context_line":"                    break"},{"line_number":113,"context_line":"                return opt.data[4:8]"},{"line_number":114,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _get_req_t2(self, options):"},{"line_number":117,"context_line":"        \"\"\"Get request time interval T2 option for IA_NA."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":120,"context_line":"        use the default value."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        for opt in options:"},{"line_number":123,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":124,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[8:12])"},{"line_number":125,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"                return opt.data[8:12]"},{"line_number":128,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":131,"context_line":"        \"\"\"Get request Preferred Lifetime for IA_NA."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        The \"Preferred Lifetime\" specifies the number of seconds"},{"line_number":134,"context_line":"        that this prefix is preferred for use when the RA indicates"},{"line_number":135,"context_line":"        that Stateless Address Auto-Configuration (SLAAC) is used."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":138,"context_line":"        use the default value."},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        for opt in options:"},{"line_number":141,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":142,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-8:-4])"},{"line_number":143,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":144,"context_line":"                    break"},{"line_number":145,"context_line":"                return opt.data[-8:-4]"},{"line_number":146,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":149,"context_line":"        \"\"\"Get request Valid Lifetime for IA_NA."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        The \"Valid Lifetime\" specifies the number of seconds"},{"line_number":152,"context_line":"        that this prefix will be used on this network"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":155,"context_line":"        use the default value."},{"line_number":156,"context_line":"        \"\"\""},{"line_number":157,"context_line":"        for opt in options:"},{"line_number":158,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":159,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-4:])"},{"line_number":160,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":161,"context_line":"                    break"},{"line_number":162,"context_line":"                return opt.data[-4:]"},{"line_number":163,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_ia_id(self, options):"},{"line_number":166,"context_line":"        \"\"\"Get request IAID for IA_NA."}],"source_content_type":"text/x-python","patch_set":22,"id":"d1be939a_256e9aa9","line":163,"range":{"start_line":102,"start_character":0,"end_line":163,"end_character":62},"in_reply_to":"3bf54c23_49fc9f3a","updated":"2021-05-20 10:53:57.000000000","message":"According to coverage report actual indexes are not tested: https://storage.bhs.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_016/773283/22/check/openstack-tox-cover/016d940/cover/neutron_agent_l2_extensions_dhcp_ipv6_py.html\n\nI would still prefer refactored version over duplication (and I don\u0027t see anything implicit there) + it will also reduce number of options iterations from 4 to 1","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8ff3eab15a5114fb52ac191199a7da0fd4f9b204","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":100,"context_line":"        return status_code + message_bin"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_req_t1(self, options):"},{"line_number":103,"context_line":"        \"\"\"Get request time interval T1 option for IA_NA."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":106,"context_line":"        use the default value."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        for opt in options:"},{"line_number":109,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":110,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[4:8])"},{"line_number":111,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":112,"context_line":"                    break"},{"line_number":113,"context_line":"                return opt.data[4:8]"},{"line_number":114,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _get_req_t2(self, options):"},{"line_number":117,"context_line":"        \"\"\"Get request time interval T2 option for IA_NA."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":120,"context_line":"        use the default value."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        for opt in options:"},{"line_number":123,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":124,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[8:12])"},{"line_number":125,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"                return opt.data[8:12]"},{"line_number":128,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":131,"context_line":"        \"\"\"Get request Preferred Lifetime for IA_NA."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        The \"Preferred Lifetime\" specifies the number of seconds"},{"line_number":134,"context_line":"        that this prefix is preferred for use when the RA indicates"},{"line_number":135,"context_line":"        that Stateless Address Auto-Configuration (SLAAC) is used."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":138,"context_line":"        use the default value."},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        for opt in options:"},{"line_number":141,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":142,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-8:-4])"},{"line_number":143,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":144,"context_line":"                    break"},{"line_number":145,"context_line":"                return opt.data[-8:-4]"},{"line_number":146,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":149,"context_line":"        \"\"\"Get request Valid Lifetime for IA_NA."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        The \"Valid Lifetime\" specifies the number of seconds"},{"line_number":152,"context_line":"        that this prefix will be used on this network"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":155,"context_line":"        use the default value."},{"line_number":156,"context_line":"        \"\"\""},{"line_number":157,"context_line":"        for opt in options:"},{"line_number":158,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":159,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-4:])"},{"line_number":160,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":161,"context_line":"                    break"},{"line_number":162,"context_line":"                return opt.data[-4:]"},{"line_number":163,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_ia_id(self, options):"},{"line_number":166,"context_line":"        \"\"\"Get request IAID for IA_NA."}],"source_content_type":"text/x-python","patch_set":22,"id":"3bf54c23_49fc9f3a","line":163,"range":{"start_line":102,"start_character":0,"end_line":163,"end_character":62},"in_reply_to":"610e0d27_f3fc680a","updated":"2021-05-20 10:02:50.000000000","message":"I tried that, the refactor code is abit ugly because of the different index.\n\n    def _get_ia_na_attrs(self, options):\n        attrs \u003d {}\n        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)\n\n        def _check_and_get_value(data, start, end\u003dNone):\n                if end is not None:\n                    data \u003d struct.unpack(\u0027!i\u0027, data[start:end])\n                else:\n                    data \u003d struct.unpack(\u0027!i\u0027, data[start:])\n                if not data or data[0] \u003d\u003d 0:\n                    return default_value\n                else:\n                    return (opt.data[start:end] if end is not None else\n                            opt.data[start:])\n\n        for opt in options:\n            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:\n                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt.data, 4, 8)\n                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt.data, 8, 12)\n                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value(\n                    opt.data, -8, -4)\n                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value(opt.data, -4)\n\nExplicit is better than implicit. And we have unit test case for all these method, so it should be fine for unexpected regression","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9e292acbcef9dbf492fe45704755859b38821ebe","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":100,"context_line":"        return status_code + message_bin"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_req_t1(self, options):"},{"line_number":103,"context_line":"        \"\"\"Get request time interval T1 option for IA_NA."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":106,"context_line":"        use the default value."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        for opt in options:"},{"line_number":109,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":110,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[4:8])"},{"line_number":111,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":112,"context_line":"                    break"},{"line_number":113,"context_line":"                return opt.data[4:8]"},{"line_number":114,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _get_req_t2(self, options):"},{"line_number":117,"context_line":"        \"\"\"Get request time interval T2 option for IA_NA."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":120,"context_line":"        use the default value."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        for opt in options:"},{"line_number":123,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":124,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[8:12])"},{"line_number":125,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"                return opt.data[8:12]"},{"line_number":128,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _get_req_preferred_lifetime(self, options):"},{"line_number":131,"context_line":"        \"\"\"Get request Preferred Lifetime for IA_NA."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        The \"Preferred Lifetime\" specifies the number of seconds"},{"line_number":134,"context_line":"        that this prefix is preferred for use when the RA indicates"},{"line_number":135,"context_line":"        that Stateless Address Auto-Configuration (SLAAC) is used."},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":138,"context_line":"        use the default value."},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        for opt in options:"},{"line_number":141,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":142,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-8:-4])"},{"line_number":143,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":144,"context_line":"                    break"},{"line_number":145,"context_line":"                return opt.data[-8:-4]"},{"line_number":146,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _get_req_valid_lifetime(self, options):"},{"line_number":149,"context_line":"        \"\"\"Get request Valid Lifetime for IA_NA."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        The \"Valid Lifetime\" specifies the number of seconds"},{"line_number":152,"context_line":"        that this prefix will be used on this network"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        If client side have the settings, use it, otherwise"},{"line_number":155,"context_line":"        use the default value."},{"line_number":156,"context_line":"        \"\"\""},{"line_number":157,"context_line":"        for opt in options:"},{"line_number":158,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":159,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[-4:])"},{"line_number":160,"context_line":"                if not data or data[0] \u003d\u003d 0:"},{"line_number":161,"context_line":"                    break"},{"line_number":162,"context_line":"                return opt.data[-4:]"},{"line_number":163,"context_line":"        return struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_ia_id(self, options):"},{"line_number":166,"context_line":"        \"\"\"Get request IAID for IA_NA."}],"source_content_type":"text/x-python","patch_set":22,"id":"a15833f3_00b52c98","line":163,"range":{"start_line":102,"start_character":0,"end_line":163,"end_character":62},"in_reply_to":"d1be939a_256e9aa9","updated":"2021-05-21 00:57:01.000000000","message":"Done for the coverage.","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d3021bb0566697b0c7296171b5a0bb1974b7f55","unresolved":true,"context_lines":[{"line_number":177,"context_line":"        return struct.pack(\u0027!I\u0027, 1)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":180,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":181,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":182,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":183,"context_line":"        # IA Address"}],"source_content_type":"text/x-python","patch_set":22,"id":"3564fc21_4a0a282a","line":180,"range":{"start_line":180,"start_character":8,"end_line":180,"end_character":33},"updated":"2021-05-20 09:01:26.000000000","message":"why? please also check all below code comments, if they really help readability or the opposite","commit_id":"357c79297c2cecc1428014f1bf77bd96004b8774"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"26b227e1be69fcd8ca072f7d09cd81b98109205c","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"568f902d_6307c38e","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"updated":"2021-05-21 07:50:15.000000000","message":"iterating through options 4 times while 1 iteration is enough","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b4f1bad5f608825b0832a4fd50a57e8fc9df7349","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"ee263169_d71ab4fc","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"38b4b423_0efd389e","updated":"2021-05-26 11:16:41.000000000","message":"Done","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"447d35676166ce4dea0dc2c8d291791ea9e4bc64","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"a48fe041_d67e1307","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"568f902d_6307c38e","updated":"2021-05-25 02:54:39.000000000","message":"Will add a TODO here, let\u0027s refactor it in a follow-up patch, since the stability of the current code is basically convergent.","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"5e6075debff228108c3766cb8ef3e3a79496e886","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"a92ec2ce_8c7a587c","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"6fae2795_5fb721d6","updated":"2021-05-25 08:21:40.000000000","message":"I\u0027m confused...:) Since you insist we should refactor the IA_NA opts methods. But it is stable enough with covered unit test cases. My idea is left as it is now, because:\n1. the stability of the current code is basically convergent.\n2. do not couple the code, since these methods are relatively new, not sure if somday one of those option methods will be changed based on some protocol clarification.\n3. DHCPv6 options does not have tons of options, 4 times loop should not hurt the performance.\n\nSo, if you still insist to refactor these methods, IMO, let\u0027s do it in a follow-up patch. Because we will remove some methods with its correlative unit cases.","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c32dfcf21e0a55be3dd015492cca4514c17343c4","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"6fae2795_5fb721d6","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"a48fe041_d67e1307","updated":"2021-05-25 07:51:04.000000000","message":"How would a follow-up patch ensure stability better than current patch? All this code is well covered with unit tests already","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2b05fe77875f19f2ad3ee03fe7e135ae6da70b43","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"e1e79abb_e6588fdf","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"a92ec2ce_8c7a587c","updated":"2021-05-25 08:38:19.000000000","message":"The reason is simple - I want to drive my review to the final +2, because I really like this feature and appreciate your efforts to opensource it. But I simply can\u0027t give a +2 on a code which I think must be refactored right away to avoid code duplication and redundant list iterations. I also think once code is well covered with unit tests (which is already done in this patch) - it should be safe to refactor + string parsing does not seem a very complex thing  to be refactored :)","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9231ceadea415d6843829460eb0f874ac9218fa4","unresolved":true,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":177,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"},{"line_number":178,"context_line":"        ia_t1 \u003d self._get_req_t1(options)"},{"line_number":179,"context_line":"        ia_t2 \u003d self._get_req_t2(options)"},{"line_number":180,"context_line":"        # IA Address"},{"line_number":181,"context_line":"        # Option: IA Address (5)"},{"line_number":182,"context_line":"        ia_addr_opt \u003d struct.pack(\u0027!H\u0027, dhcp6.DHCPV6_OPTION_IAADDR)"},{"line_number":183,"context_line":"        # IPv6 address: client IPv6 Address"},{"line_number":184,"context_line":"        ia_addr_bin \u003d addrconv.ipv6.text_to_bin(str(ip_addr))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        preferred_lifetime \u003d self._get_req_preferred_lifetime(options)"},{"line_number":187,"context_line":"        valid_lifetime \u003d self._get_req_valid_lifetime(options)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        ia \u003d ia_addr_bin + preferred_lifetime + valid_lifetime"},{"line_number":190,"context_line":"        # Length: 24"}],"source_content_type":"text/x-python","patch_set":23,"id":"38b4b423_0efd389e","line":187,"range":{"start_line":178,"start_character":8,"end_line":187,"end_character":62},"in_reply_to":"e1e79abb_e6588fdf","updated":"2021-05-25 09:09:39.000000000","message":"Alright, let\u0027s start a new round review...","commit_id":"5441e9d77b3a4692fd5fc71d3c57e92fc844432a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"6b2f9fe2297c4206bae38fe79216f6b67642ab9f","unresolved":true,"context_lines":[{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"}],"source_content_type":"text/x-python","patch_set":26,"id":"16e5f0c0_351352e1","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":49},"updated":"2021-05-31 10:22:44.000000000","message":"This should be \"start is None and end is not None:\".\n\nAll these if-else blocks are not human readable, I will add comments to each condition....","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9fbee8a541a61d83472676326d6e7acc9ea7f01d","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":96,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":97,"context_line":"        return status_code + message_bin"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_ia_na_attrs(self, options):"},{"line_number":100,"context_line":"        \"\"\"Get IA_NA options."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Get request time interval T1 option for IA_NA."},{"line_number":103,"context_line":"        Get request time interval T2 option for IA_NA."},{"line_number":104,"context_line":"        Get request Preferred Lifetime for IA_NA."},{"line_number":105,"context_line":"        Get request Valid Lifetime for IA_NA."},{"line_number":106,"context_line":"        Get request IAID for IA_NA."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":112,"context_line":"            if end is not None:"},{"line_number":113,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":116,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":117,"context_line":"                if start is not None and end is not None:"},{"line_number":118,"context_line":"                    return opt.data[start:end]"},{"line_number":119,"context_line":"                elif start is None and end is not None:"},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"},{"line_number":128,"context_line":"            return default_value"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        for opt in options:"},{"line_number":131,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":132,"context_line":"                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)"},{"line_number":133,"context_line":"                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)"},{"line_number":134,"context_line":"                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":135,"context_line":"                    opt, -8, -4)"},{"line_number":136,"context_line":"                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":137,"context_line":"                    opt, start\u003d-4)"},{"line_number":138,"context_line":"                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, end\u003d4)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        return attrs"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":143,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"}],"source_content_type":"text/x-python","patch_set":26,"id":"30c5f752_f1a14a00","line":140,"range":{"start_line":98,"start_character":0,"end_line":140,"end_character":20},"updated":"2021-05-26 14:49:58.000000000","message":"Looks a bit ugly, since every attributes are in coupled acquisition now. Nothing better than previous style.","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ef00503f12f3ee15b0e75db314f931e6ee2eb07","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":96,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":97,"context_line":"        return status_code + message_bin"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_ia_na_attrs(self, options):"},{"line_number":100,"context_line":"        \"\"\"Get IA_NA options."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Get request time interval T1 option for IA_NA."},{"line_number":103,"context_line":"        Get request time interval T2 option for IA_NA."},{"line_number":104,"context_line":"        Get request Preferred Lifetime for IA_NA."},{"line_number":105,"context_line":"        Get request Valid Lifetime for IA_NA."},{"line_number":106,"context_line":"        Get request IAID for IA_NA."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":112,"context_line":"            if end is not None:"},{"line_number":113,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":116,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":117,"context_line":"                if start is not None and end is not None:"},{"line_number":118,"context_line":"                    return opt.data[start:end]"},{"line_number":119,"context_line":"                elif start is None and end is not None:"},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"},{"line_number":128,"context_line":"            return default_value"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        for opt in options:"},{"line_number":131,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":132,"context_line":"                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)"},{"line_number":133,"context_line":"                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)"},{"line_number":134,"context_line":"                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":135,"context_line":"                    opt, -8, -4)"},{"line_number":136,"context_line":"                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":137,"context_line":"                    opt, start\u003d-4)"},{"line_number":138,"context_line":"                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, end\u003d4)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        return attrs"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":143,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"}],"source_content_type":"text/x-python","patch_set":26,"id":"695f3ecb_7e7b344a","line":140,"range":{"start_line":98,"start_character":0,"end_line":140,"end_character":20},"in_reply_to":"30c5f752_f1a14a00","updated":"2021-05-26 15:03:00.000000000","message":"consider making \u0027start\u0027 and \u0027end\u0027 required parameters, checks for None (which I believe you refer as ugly) won\u0027t be needed:\n\ns[start:] \u003d\u003d\u003d s[start:len(s)]\ns[:end] \u003d\u003d\u003d s[0:end]","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"6b2f9fe2297c4206bae38fe79216f6b67642ab9f","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":96,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":97,"context_line":"        return status_code + message_bin"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_ia_na_attrs(self, options):"},{"line_number":100,"context_line":"        \"\"\"Get IA_NA options."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Get request time interval T1 option for IA_NA."},{"line_number":103,"context_line":"        Get request time interval T2 option for IA_NA."},{"line_number":104,"context_line":"        Get request Preferred Lifetime for IA_NA."},{"line_number":105,"context_line":"        Get request Valid Lifetime for IA_NA."},{"line_number":106,"context_line":"        Get request IAID for IA_NA."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":112,"context_line":"            if end is not None:"},{"line_number":113,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":116,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":117,"context_line":"                if start is not None and end is not None:"},{"line_number":118,"context_line":"                    return opt.data[start:end]"},{"line_number":119,"context_line":"                elif start is None and end is not None:"},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"},{"line_number":128,"context_line":"            return default_value"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        for opt in options:"},{"line_number":131,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":132,"context_line":"                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)"},{"line_number":133,"context_line":"                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)"},{"line_number":134,"context_line":"                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":135,"context_line":"                    opt, -8, -4)"},{"line_number":136,"context_line":"                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":137,"context_line":"                    opt, start\u003d-4)"},{"line_number":138,"context_line":"                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, end\u003d4)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        return attrs"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":143,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"}],"source_content_type":"text/x-python","patch_set":26,"id":"e5d078c8_118cc196","line":140,"range":{"start_line":98,"start_character":0,"end_line":140,"end_character":20},"in_reply_to":"695f3ecb_7e7b344a","updated":"2021-05-31 10:22:44.000000000","message":"But default IAID is one case rely on the start and end value.","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fbdfd227b7478e80e3a5d81419b819dd49d7df81","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":96,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":97,"context_line":"        return status_code + message_bin"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_ia_na_attrs(self, options):"},{"line_number":100,"context_line":"        \"\"\"Get IA_NA options."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Get request time interval T1 option for IA_NA."},{"line_number":103,"context_line":"        Get request time interval T2 option for IA_NA."},{"line_number":104,"context_line":"        Get request Preferred Lifetime for IA_NA."},{"line_number":105,"context_line":"        Get request Valid Lifetime for IA_NA."},{"line_number":106,"context_line":"        Get request IAID for IA_NA."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":112,"context_line":"            if end is not None:"},{"line_number":113,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":116,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":117,"context_line":"                if start is not None and end is not None:"},{"line_number":118,"context_line":"                    return opt.data[start:end]"},{"line_number":119,"context_line":"                elif start is None and end is not None:"},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"},{"line_number":128,"context_line":"            return default_value"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        for opt in options:"},{"line_number":131,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":132,"context_line":"                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)"},{"line_number":133,"context_line":"                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)"},{"line_number":134,"context_line":"                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":135,"context_line":"                    opt, -8, -4)"},{"line_number":136,"context_line":"                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":137,"context_line":"                    opt, start\u003d-4)"},{"line_number":138,"context_line":"                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, end\u003d4)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        return attrs"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":143,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"}],"source_content_type":"text/x-python","patch_set":26,"id":"f0cd8a76_2931528c","line":140,"range":{"start_line":98,"start_character":0,"end_line":140,"end_character":20},"in_reply_to":"6a3b2412_fe7756d2","updated":"2021-06-07 03:26:09.000000000","message":"Comments added for these conditions, and saving a loop for it, so let\u0027s leave it as it is.","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"ec2648046ccb1264071738c6891d6118d1895e9e","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        message_bin \u003d struct.pack(\u0027!%ds\u0027 % len(message),"},{"line_number":96,"context_line":"                                  bytes(str(message).encode()))"},{"line_number":97,"context_line":"        return status_code + message_bin"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_ia_na_attrs(self, options):"},{"line_number":100,"context_line":"        \"\"\"Get IA_NA options."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Get request time interval T1 option for IA_NA."},{"line_number":103,"context_line":"        Get request time interval T2 option for IA_NA."},{"line_number":104,"context_line":"        Get request Preferred Lifetime for IA_NA."},{"line_number":105,"context_line":"        Get request Valid Lifetime for IA_NA."},{"line_number":106,"context_line":"        Get request IAID for IA_NA."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        attrs \u003d {}"},{"line_number":109,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":112,"context_line":"            if end is not None:"},{"line_number":113,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":116,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":117,"context_line":"                if start is not None and end is not None:"},{"line_number":118,"context_line":"                    return opt.data[start:end]"},{"line_number":119,"context_line":"                elif start is None and end is not None:"},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":"                elif start is not None and end is None:"},{"line_number":122,"context_line":"                    return opt.data[start:]"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"            if start is not None and end is None:"},{"line_number":125,"context_line":"                # default IAID"},{"line_number":126,"context_line":"                return struct.pack(\u0027!I\u0027, 1)"},{"line_number":127,"context_line":"            # default time or interval"},{"line_number":128,"context_line":"            return default_value"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        for opt in options:"},{"line_number":131,"context_line":"            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:"},{"line_number":132,"context_line":"                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)"},{"line_number":133,"context_line":"                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)"},{"line_number":134,"context_line":"                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":135,"context_line":"                    opt, -8, -4)"},{"line_number":136,"context_line":"                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value("},{"line_number":137,"context_line":"                    opt, start\u003d-4)"},{"line_number":138,"context_line":"                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, end\u003d4)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        return attrs"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def _get_ia_na_opt(self, options, ip_addr):"},{"line_number":143,"context_line":"        # DHCPV6_OPTION_IA_NA \u003d 3"}],"source_content_type":"text/x-python","patch_set":26,"id":"6a3b2412_fe7756d2","line":140,"range":{"start_line":98,"start_character":0,"end_line":140,"end_character":20},"in_reply_to":"e5d078c8_118cc196","updated":"2021-05-31 10:41:00.000000000","message":"I\u0027d suggest to handle default IAID separately, not with _check_and_get_value","commit_id":"62ce5012ca8e2e9a93fbe0ed9c7d20223714252e"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"dfd066c3cff5a645d1423f0f7b4ba45639008fc3","unresolved":true,"context_lines":[{"line_number":102,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":105,"context_line":"            if end is not None:"},{"line_number":106,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":107,"context_line":"            else:"},{"line_number":108,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":109,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":110,"context_line":"                if start is not None and end is not None:"},{"line_number":111,"context_line":"                    # Get request time interval T1 option for IA_NA."},{"line_number":112,"context_line":"                    # Get request time interval T2 option for IA_NA."},{"line_number":113,"context_line":"                    # Get request Preferred Lifetime for IA_NA."},{"line_number":114,"context_line":"                    return opt.data[start:end]"},{"line_number":115,"context_line":"                elif start is not None and end is None:"},{"line_number":116,"context_line":"                    # Get request Valid Lifetime for IA_NA."},{"line_number":117,"context_line":"                    return opt.data[start:]"},{"line_number":118,"context_line":"                elif start is None and end is not None:"},{"line_number":119,"context_line":"                    # Get request IAID for IA_NA."},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"            if start is None and end is not None:"},{"line_number":123,"context_line":"                # default IAID"}],"source_content_type":"text/x-python","patch_set":27,"id":"8aee9ee1_a0a6c296","line":120,"range":{"start_line":105,"start_character":12,"end_line":120,"end_character":41},"updated":"2021-06-07 08:23:59.000000000","message":"Sorry but these None\u0027s are not readable. Please check:\n\n    def _get_ia_na_attrs(self, options):\n        \"\"\"Get IA_NA options.\"\"\"\n        attrs \u003d {}\n        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)\n\n        def _check_and_get_value(opt, start, end, iaid\u003dFalse):\n            data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])\n            if data and data[0] !\u003d 0:\n                return opt.data[start:end]\n            elif iaid:\n                # default IAID\n                return struct.pack(\u0027!I\u0027, 1)\n            # default time or interval\n            return default_value\n\n        for opt in options:\n            if opt.code \u003d\u003d dhcp6.DHCPV6_OPTION_IA_NA:\n                attrs[\u0027t1\u0027] \u003d _check_and_get_value(opt, 4, 8)\n                attrs[\u0027t2\u0027] \u003d _check_and_get_value(opt, 8, 12)\n                attrs[\u0027preferred_lifetime\u0027] \u003d _check_and_get_value(\n                    opt, -8, -4)\n                attrs[\u0027valid_lifetime\u0027] \u003d _check_and_get_value(\n                    opt, -4, len(opt.data))\n                attrs[\u0027ia_id\u0027] \u003d _check_and_get_value(opt, 0, 4, iaid\u003dTrue)\n\n        return attrs\n\nlooks more clear and compact, do you agree?","commit_id":"deea7731a80b0bf7c83c5c2bd08a890a3512f2e3"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"465dd23d674384fa3ae7a35fc8f66cfb2df336cb","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        default_value \u003d struct.pack(\u0027!i\u0027, cfg.CONF.dhcp_lease_duration)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        def _check_and_get_value(opt, start\u003dNone, end\u003dNone):"},{"line_number":105,"context_line":"            if end is not None:"},{"line_number":106,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:end])"},{"line_number":107,"context_line":"            else:"},{"line_number":108,"context_line":"                data \u003d struct.unpack(\u0027!i\u0027, opt.data[start:])"},{"line_number":109,"context_line":"            if data and data[0] !\u003d 0:"},{"line_number":110,"context_line":"                if start is not None and end is not None:"},{"line_number":111,"context_line":"                    # Get request time interval T1 option for IA_NA."},{"line_number":112,"context_line":"                    # Get request time interval T2 option for IA_NA."},{"line_number":113,"context_line":"                    # Get request Preferred Lifetime for IA_NA."},{"line_number":114,"context_line":"                    return opt.data[start:end]"},{"line_number":115,"context_line":"                elif start is not None and end is None:"},{"line_number":116,"context_line":"                    # Get request Valid Lifetime for IA_NA."},{"line_number":117,"context_line":"                    return opt.data[start:]"},{"line_number":118,"context_line":"                elif start is None and end is not None:"},{"line_number":119,"context_line":"                    # Get request IAID for IA_NA."},{"line_number":120,"context_line":"                    return opt.data[:end]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"            if start is None and end is not None:"},{"line_number":123,"context_line":"                # default IAID"}],"source_content_type":"text/x-python","patch_set":27,"id":"df4ae5c7_66aa3e40","line":120,"range":{"start_line":105,"start_character":12,"end_line":120,"end_character":41},"in_reply_to":"8aee9ee1_a0a6c296","updated":"2021-06-10 01:13:43.000000000","message":"Done","commit_id":"deea7731a80b0bf7c83c5c2bd08a890a3512f2e3"}],"neutron/conf/plugins/ml2/drivers/ovs_conf.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"316cadf9c77c65893f0232f7b55a4849f7251741","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_dhcp_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"DHCP for IPv6\")),"},{"line_number":180,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":181,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""}],"source_content_type":"text/x-python","patch_set":5,"id":"443e3a64_286e55a6","line":178,"updated":"2021-02-22 19:46:47.000000000","message":"Should this be \u0027enable_ipv6\u0027?  The other two had \u0027dhcp\u0027 in them in the spec too, but since they are in the [dhcp] section it implies they are for DHCP.","commit_id":"7bdd3be8a02b75efb050e480325151f4dd79e1cd"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"5cd7882b978c3c26b40f9ebad033cbea8d3dde13","unresolved":false,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_dhcp_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"DHCP for IPv6\")),"},{"line_number":180,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":181,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""}],"source_content_type":"text/x-python","patch_set":5,"id":"307b1bf3_77af0061","line":178,"in_reply_to":"443e3a64_286e55a6","updated":"2021-02-23 01:43:42.000000000","message":"Done","commit_id":"7bdd3be8a02b75efb050e480325151f4dd79e1cd"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"41ad1a9f5c5be51b848842422fd2eca33532a1fb","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":14,"id":"6b038288_5f4e0fe9","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"updated":"2021-03-12 11:42:09.000000000","message":"This has no effect on IPv6 availability otherwise, like operator can create subnet with ipv6 even if this is False?\nI see this as controversial, as current dhcp-agent will serv dhcp if the subnet is IPv6 for the port.","commit_id":"be4811fed6aba83cf13c8f156e113e6d8db4adef"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c31abd76dd55bd0281dbec83b2f946363a10ab3d","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":14,"id":"9bb9e145_be28fbf4","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"in_reply_to":"6b038288_5f4e0fe9","updated":"2021-03-15 02:24:17.000000000","message":"Sorry, I\u0027m afraid to say I get your real point. This option is for operators who want to disable the DHCPv6. Then this agent extension will skip some IPv6 related processing. For instance, some deployment may need user to config the IPv6 address inside the VM manually.","commit_id":"be4811fed6aba83cf13c8f156e113e6d8db4adef"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"f7d91ee2da8da82bb2d2fae8e47e0ef8762a9c63","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":20,"id":"d29f3fba_42fab79b","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"updated":"2021-05-13 15:37:10.000000000","message":"I have 2 concerns with this config option:\n1.) this should be in the next patch (https://review.opendev.org/c/openstack/neutron/+/776567 )\n2.) If I understand well currently I can set ipv6 address and mode (ra, slaac....) for the subnet on the API, this config option breaks that assumption, so I vote against it.","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"443eb13bdf106ec2d38e8dad8954db6d39c93c52","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":20,"id":"5360effe_c367bcc7","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"in_reply_to":"318415bf_b61930f3","updated":"2021-05-14 10:45:25.000000000","message":"The DHCP agent extension only takes care of the DHCPv6 related requests, it is UDPv6 (with port 546/547). The RA related packet is based on ICMPv6. The RA and address_mode will no be influenced. The DHCPv6 request will be for address and other config options based on the \"router\" RA notification.\n\nRelevant, but not the most important. This is a very common paradox. Such as, in API side, you create DVR router, but you have no agents set to \"dvr\" mode. You set enable_dhcp \u003d True, but you have no running DHCP-agents. Operators should take care of the config differences between API and agents.","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"f3d3e2ae5cdee1c31e188a26800fc8383f320a7c","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":20,"id":"905eff6f_f98e52e2","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"in_reply_to":"5360effe_c367bcc7","updated":"2021-05-14 11:49:12.000000000","message":"My concern is that the 2 different dhcp solution will work differently for IPv6.","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"546aa9ac76d288a491e2410956070fe9df25483b","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":20,"id":"feb211ce_05547588","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"in_reply_to":"d29f3fba_42fab79b","updated":"2021-05-14 02:06:29.000000000","message":"1.) Make sense, I will move it.\n2.) For some IPv4 only deployment, they may not need IPv6 related funtions. It\u0027s a simple option for DHCP extension to decide whether install the flows for port DHCPv6.","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"b313b02c2f8ba277b83eafd54736c1f999dc739c","unresolved":true,"context_lines":[{"line_number":175,"context_line":"]"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"dhcp_opts \u003d ["},{"line_number":178,"context_line":"    cfg.BoolOpt(\u0027enable_ipv6\u0027, default\u003dFalse,"},{"line_number":179,"context_line":"                help\u003d_(\"This is for the DHCPv6, if True, the ovs agent DHCP \""},{"line_number":180,"context_line":"                       \"extension will add related flows for \""},{"line_number":181,"context_line":"                       \"DHCPv6 packets.\")),"},{"line_number":182,"context_line":"    cfg.IntOpt(\u0027renewal_time\u0027, default\u003d0,"},{"line_number":183,"context_line":"               help\u003d_(\"DHCP renewal time T1 (in seconds). If set to 0, it \""},{"line_number":184,"context_line":"                      \"will default to half of the lease time.\")),"}],"source_content_type":"text/x-python","patch_set":20,"id":"318415bf_b61930f3","line":181,"range":{"start_line":178,"start_character":0,"end_line":181,"end_character":43},"in_reply_to":"feb211ce_05547588","updated":"2021-05-14 09:29:01.000000000","message":"But then the API will behave differently in case distributed OVS based dhcp is used in a deployment.\nCurrently on the API there are flags for dhcp (like enable_dhcp, ipv6_address_mode, ipv6_ra_mode...) and with this config option the API will behave differently for \"traditional dhcp-agent \u0026 dnsmasq\" based neutron deployment and for distributed ovs-agent based deployment","commit_id":"aa173924ad57d4ed6ed0af55a847075005097034"}],"neutron/tests/unit/agent/l2/extensions/dhcp/test_ipv6.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _create_test_dhcp6_packet(self, zero_time\u003dFalse):"},{"line_number":54,"context_line":"        ret_pkt \u003d packet.Packet()"},{"line_number":55,"context_line":"        ret_pkt.add_protocol(ethernet.ethernet("},{"line_number":56,"context_line":"            ethertype\u003dether_types.ETH_TYPE_IPV6,"},{"line_number":57,"context_line":"            dst\u003d\u002733:33:00:01:00:02\u0027,"},{"line_number":58,"context_line":"            src\u003dself.port_info[\u0027mac_address\u0027]))"}],"source_content_type":"text/x-python","patch_set":21,"id":"97c34d81_f362b767","line":55,"range":{"start_line":55,"start_character":29,"end_line":55,"end_character":47},"updated":"2021-05-18 20:09:53.000000000","message":"nit: I would move it to the next line - it would be more readable IMO - see L60-63","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e4e6cb970dc630975a5aeec34c29510a8090c4b5","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _create_test_dhcp6_packet(self, zero_time\u003dFalse):"},{"line_number":54,"context_line":"        ret_pkt \u003d packet.Packet()"},{"line_number":55,"context_line":"        ret_pkt.add_protocol(ethernet.ethernet("},{"line_number":56,"context_line":"            ethertype\u003dether_types.ETH_TYPE_IPV6,"},{"line_number":57,"context_line":"            dst\u003d\u002733:33:00:01:00:02\u0027,"},{"line_number":58,"context_line":"            src\u003dself.port_info[\u0027mac_address\u0027]))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ac5eaed2_b144ede3","line":55,"range":{"start_line":55,"start_character":29,"end_line":55,"end_character":47},"in_reply_to":"97c34d81_f362b767","updated":"2021-05-20 03:16:47.000000000","message":"Done","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3def7271a4eab2f9003fcb3dd4e937533617e4b2","unresolved":true,"context_lines":[{"line_number":61,"context_line":"                src\u003d\u0027fe80::f816:3eff:fe60:714b\u0027,"},{"line_number":62,"context_line":"                dst\u003d\u0027ff02::1:2\u0027,"},{"line_number":63,"context_line":"                nxt\u003dinet.IPPROTO_UDP))"},{"line_number":64,"context_line":"        ret_pkt.add_protocol(udp.udp("},{"line_number":65,"context_line":"            src_port\u003dconstants.DHCPV6_RESPONSE_PORT,"},{"line_number":66,"context_line":"            dst_port\u003dconstants.DHCPV6_CLIENT_PORT))"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"f29b2fbc_d84e840b","line":64,"updated":"2021-05-18 20:09:53.000000000","message":"same nit here, and in other places below","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e4e6cb970dc630975a5aeec34c29510a8090c4b5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                src\u003d\u0027fe80::f816:3eff:fe60:714b\u0027,"},{"line_number":62,"context_line":"                dst\u003d\u0027ff02::1:2\u0027,"},{"line_number":63,"context_line":"                nxt\u003dinet.IPPROTO_UDP))"},{"line_number":64,"context_line":"        ret_pkt.add_protocol(udp.udp("},{"line_number":65,"context_line":"            src_port\u003dconstants.DHCPV6_RESPONSE_PORT,"},{"line_number":66,"context_line":"            dst_port\u003dconstants.DHCPV6_CLIENT_PORT))"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"6b58dc8e_43d448e1","line":64,"in_reply_to":"f29b2fbc_d84e840b","updated":"2021-05-20 03:16:47.000000000","message":"Done","commit_id":"2d48e6f1270e6f88b3f1a994d2bb438f0c276b36"}]}
