openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
162 stars 98 forks source link

odhcpd includes reconfigure-accept and opt 82 even if client didn't ask for it #110

Closed mikaabra closed 6 years ago

mikaabra commented 6 years ago

I tried connecting a Ubiquiti ER-lite to a standard LEDE 17.01.4 with updated odhcpd package:

odhcpd - 2018-03-02-2da5850f-3

Even though the ER-lite doesn't ask for reconfigure-accept option, odhcpd includes this option in the reply anyway. This causes the ER-lite to log an error and not use any of the information:

May/07/2018 14:49:19: dhcp6_get_options: unknown or unexpected DHCP6 option opt_82, len 4
May/07/2018 14:49:19: dhcp6_get_options: received option: "reconfigure accept" (len 0), however reconfigure negotiation is not supported yet
May/07/2018 14:49:19: dhcp6_get_options: unsupported authentication protocol: 1
May/07/2018 14:49:19: client6_recv: failed to parse options

Standard DHCP behaviour is to only include options the client asked for, so I have problems faulting the client behaviour in this case. Rather, odhcpd should not include reconfigure-accept if the client didn't ask for it. Same thing with option 82 (but I doubt option 82 here causes the client to throw an error, so that's probably less of a problem).

Below is tcpdump from the interaction between ER-lite and gateway running LEDE 17.01.4:

14:53:00.138018 IP6 (hlim 1, next-header UDP (17) payload length: 93) fe80::26a4:3cff:fe06:6882.546 > ff02::1:2.547: [udp sum ok] dhcp6 solicit (xid=8edc77 (client-ID hwaddr/time type 1 time 579014559 24a43c066881) (rapid-commit) (elapsed-time 0) (option-request DNS-server DNS-search-list) (IA_PD IAID:1 T1:0 T2:0 (IA_PD-prefix ::/64 pltime:4294967295 vltime:4294967295)))
14:53:00.139129 IP6 (flowlabel 0xc8e45, hlim 64, next-header UDP (17) payload length: 150) fe80::6666:b3ff:fede:fffc.547 > fe80::26a4:3cff:fe06:6882.546: [bad udp cksum 0xe117 -> 0x6205!] dhcp6 advertise (xid=8edc77 (server-ID hwaddr type 1 6466b3defffc) (client-ID hwaddr/time type 1 time 579014559 24a43c066881) (opt_82) (DNS-server fda8:a818:4e2f:64::1) (reconfigure-accept) (IA_PD IAID:1 T1:1255 T2:2008 (IA_PD-prefix 2003:1c09:24:1515::/64 pltime:2510 vltime:3110) (IA_PD-prefix fda8:a818:4e2f:65::/64 pltime:4294967295 vltime:4294967295)))
14:53:01.142875 IP6 (hlim 1, next-header UDP (17) payload length: 132) fe80::26a4:3cff:fe06:6882.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=e6fabd (client-ID hwaddr/time type 1 time 579014559 24a43c066881) (server-ID hwaddr type 1 6466b3defffc) (elapsed-time 0) (option-request DNS-server DNS-search-list) (IA_PD IAID:1 T1:0 T2:0 (IA_PD-prefix 2003:1c09:24:1515::/64 pltime:2510 vltime:3110) (IA_PD-prefix fda8:a818:4e2f:65::/64 pltime:4294967295 vltime:4294967295)))
14:53:01.144282 IP6 (flowlabel 0xc8e45, hlim 64, next-header UDP (17) payload length: 182) fe80::6666:b3ff:fede:fffc.547 > fe80::26a4:3cff:fe06:6882.546: [bad udp cksum 0xe137 -> 0x04d5!] dhcp6 reply (xid=e6fabd (server-ID hwaddr type 1 6466b3defffc) (client-ID hwaddr/time type 1 time 579014559 24a43c066881) (opt_82) (DNS-server fda8:a818:4e2f:64::1) (reconfigure-accept) (authentication proto: reconfigure, alg: HMAC-MD5, RDM: mono, RD: 5af0 684d 0000 000f reconfig-key value: 70e960e4 6c636f82 b6be7ee6 4b2cbae4) (IA_PD IAID:1 T1:1254 T2:2007 (IA_PD-prefix 2003:1c09:24:1515::/64 pltime:2509 vltime:3109) (IA_PD-prefix fda8:a818:4e2f:65::/64 pltime:4294967295 vltime:4294967295)))
dedeckeh commented 6 years ago

This has been fixed in commit https://github.com/openwrt/odhcpd/commit/96033e937c56a407d8ca9302c5901cd77366da29