Created attachment 7686 [details] packet trace of 'kill -HUP <udhcpc_pid' when udhcpc has -R option I'm using both BusyBox v1.25.1 packaged with LEDE 17.01.1, and Busybox v1.28.3 packaged with OpenWRT 18.06.0, on 2 routers connected to the internet in active/passive configuration. The OS's are virtualised within KVM, and their WAN interface obtains an IP address from my upstream ISP using DHCP. The DHCP client for Busybox is of course udhcpc. The IP address is obtained as normal on each router, however when I attempt to release the IP address on an interface (by 'kill -USR2 <pid>', the IP address is released on the interface from the client side, but no DHCPRELEASE message (i.e. option 53:7) is sent to the upstream ISP. This hinders my ability to change traffic from one router to another, as I have to wait for the DHCP lease to expire as normal before the ISP will accept traffic from a different router. I have attempted some modifications in an attempt to trigger the DHCPRELEASE. The first was to modify the script initialising udhcpc, to include the '-R' switch which is not included by default, and then kill the udhcpc process using 'kill -HUP <pid>', but again no DHCPRELEASE message was initiated. What was interesting though, looking at the packet trace, is that there was one DHCPDISCOVER message issued with one transaction ID, and then a range of normal DHCPDISCOVER, DHCPOFFER, DHCPREQUEST and DHCPACK, triggered by the respawned udhcpc process, with a different transaction ID. This leads me to suspect that the -R switch is generating a DHCPDISCOVER on termination instead of a DHCPRELEASE. I have also attempted to run a second udhcpc process on the same interface, and forcing the DHCPRELEASE option with the '-x' switch. This does result in a DHCP message containing the option 53:7, but the same message also contains a 53:1 option by default, so although Wireshark identifies the message as DHCPRELEASE, it is really ambiguous and arbitrary on how the server handles it. Is this a bug or expected behaviour?
Created attachment 7691 [details] packet trace when udhcpc forced to send option 53:7
(In reply to Ivan from comment #0) | The IP address is obtained as normal on each router, however when I attempt to release the IP address on an interface (by 'kill -USR2 <pid>', the IP address is released on the interface from the client side, but no DHCPRELEASE message (i.e. option 53:7) is sent to the upstream ISP. This hinders my ability to change traffic from one router to another, as I have to wait for the DHCP lease to expire as normal before the ISP will accept traffic from a different router. Can't reproduce. When I send SIGUSR2 to my udhcpc, I see this: # tcpdump -nlieth0 -vvv udp and port bootpc tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 18:58:40.779568 IP (tos 0x0, ttl 64, id 23229, offset 0, flags [DF], proto UDP (17), length 328) NN.NN.NN.NNN.bootpc > MM.MM.M.MM.bootps: [bad udp cksum 0x2c28 -> 0x2768!] BOOTP/DHCP, Request from 50:7b:XX:bf:XX:XX, length 300, xid 0x181c6419, secs 10, Flags [none] (0x0000) Client-IP NN.NN.NN.NN0 Client-Ethernet-Address 50:7b:XX:bf:XX:XX Vendor-rfc1048 Extensions Magic Cookie 0x63825363 DHCP-Message Option 53, length 1: Release Client-ID Option 61, length 7: ether 50:7b:XX:bf:XX:XX Server-ID Option 54, length 4: MM.MM.M.MM END Option 255, length 0 PAD Option 0, length 0, occurs 41