summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ip/ipconfig/dhcp.c
AgeCommit message (Collapse)Author
2023-05-21ip/ipconfig: initial dhcpv6 support, clean default-routes and /net/ndb on removecinap_lenrek
This adds a very basic (probably wrong) DHCPv6 client, to handle the "managed"-flag in IPv6 router solicitations. We add -U option to pass the DHCPv6 client id as well as an -s flag to manually add a dns server (because ppp is going to call ipconfig to handle all the configuration and write-back to /net/ndb in the future). Have the remove command also remove default routes and /net/ndb entries. (needed by ppp).
2023-05-15dhcp: fix out of bounds access in "ANDROID_METERED" fixcinap_lenrek
the previous change introduces a out of bounds access as it does not change n. it is also conceptually wrong because this routine is supposed to just verify the structure. as later getopts() is *NOT* going to deal with malfored TLV's. this actually replaces the android magic garbage with OBpad bytes, which getopts() later will handle correctly and makes sure the garbage is fully contained within the buffer boundaries. thanks sigrid for testing.
2023-05-14dhcp: skip android junk optionsOri Bernstein
2022-08-13ip/ipconfig: we do not want icmp advice errors on our dhcp connectioncinap_lenrek
2022-06-05ip/ipconfig: refactor plan9 vendor parsingJacob Moody
Unless ip/dhcpd is started with the -6 option, we only receive v4 addresses. If we do see the v6 options we should prefer them but should also make sure we grab the v4 addresses as a fallback. None of the v6 options should overwrite valid overrides given at the command line. Add our custom types to logging.
2021-04-11ip/ipconfig: ODtftpserver (dhcp option 66) is of type stringcinap_lenrek
2019-09-06ip/ipconfig: don't leave behind null address when dhcp gets interruptedcinap_lenrek
cleanup the null address (::) when the command gets interrupted.
2019-03-17ip/ipconfig: use defaults for loopbackcinap_lenrek
- do not write /net/ndb for loopback medium unless -p is specified - use defmask() instead of hardcoded /64 for v6 to get correct /128 mask for ::1 - only do duplicate address detection on ethernet
2019-02-13ip/ipconfig: format ipmask with %M instead of %Icinap_lenrek
2019-01-23ip/dhcpd: change swap to rootserver (thanks k0ga)cinap_lenrek
2018-09-25ip/ipconfig: implement rfc3397 dhcp dns search option (dnsdomain)cinap_lenrek
2018-09-24ip/ipconfig: handle noconfig flag for router advertisement, add debug ↵cinap_lenrek
prints, cleanup
2018-06-03ip/ipconfig: use ipmove() instead of memmove()cinap_lenrek
2018-05-01ip/ipconfig: populate /net/ndb from v6 router advertisements, configure ↵cinap_lenrek
multiple addresses in ndbconfig() we now update /net/ndb with the following information gathered from router advertisements (rfc6106 and plan9 specific options): - recursive dns servers (option 25, ndb: dns=) - dns search list (option 31, ndb: dnsdomain=) - plan9 fileserver (option 250, ndb: fs=) - plan9 authserver (option 251, ndb: auth=) note the plan9 specific options can be disabled with the -G flag. for ndbconfig (-N flag), we now collect all ip addresses in ndb belonging to the devices mac address and configue them all. v6 addresses are getting added when a link local address exists or the -6 flag has been specified to automatically configure one. move the dhcp code in its own dhcp.c file and make symbols static that are not used across modules.