NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/42325: Lease is not released with dhcpcd -k (and dnsmasq DHCP server)



>Number:         42325
>Category:       bin
>Synopsis:       Lease is not released with dhcpcd -k (and dnsmasq DHCP server)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 15 19:50:01 +0000 2009
>Originator:     gregoire.sutre%labri.fr@localhost
>Release:        NetBSD 5.0_STABLE (2009-10-24)
>Organization:
>Environment:
System: NetBSD niagara 5.0_STABLE NetBSD 5.0_STABLE (NIAGARA) #0: Sat Oct 24 
11:54:39 CEST 2009 
instsoft@niagara:/usr/build/usr/src/sys/arch/i386/compile/NIAGARA i386
Architecture: i386
Machine: i386
>Description:

This host uses dhcpcd as DHCP client.  When running `dhcpcd -k', dhcpcd says
that it released the lease, but the lease remains active on the DHCP server
(dnsmasq).

With dhclient as DHCP client, the command `dhclient -r' effectively releases
the lease on the DHCP server.

According to tcpdump, dhcpcd sends the release message to the broadcast IP
address 255.255.255.255 whereas dhclient sends it to the IP address of the
DHCP server.  There are other differences (xid and Server-ID options), the
detailed packets are provided below.

According to section 4.4.4 of RFC2131 (on the use of broadcast and unicast),
DHCPRELEASE messages should be unicasted by the client.

http://www.rfc-archive.org/getrfc.php?rfc=2131


The detailed DHCPRELEASE packets I observed on my host are the following:

--- dhcpcd -----------------------------------------------------------------

xx:xx:xx.xxxxxx IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP 
(17), length 328) 192.168.1.108.68 > 255.255.255.255.67: [udp sum ok] 
BOOTP/DHCP, Request from 00:16:6f:75:e7:5f, length 300, Flags [none] (0x0000)
          Client-IP 192.168.1.108
          Client-Ethernet-Address 00:16:6f:75:e7:5f
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Release
        0x0000:  4510 0148 0000 4000 4011 7781 c0a8 016c  E..H..@.@.w....l
        0x0010:  ffff ffff 0044 0043 0134 2704 0101 0600  .....D.C.4'.....
        0x0020:  0000 0000 0000 0000 c0a8 016c 0000 0000  ...........l....
        0x0030:  0000 0000 0000 0000 0016 6f75 e75f 0000  ..........ou._..
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 07ff  ........c.Sc5...
        0x0110:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0120:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0130:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0140:  0000 0000 0000 0000                      ........


--- dhclient ---------------------------------------------------------------

xx:xx:xx.xxxxxx IP (tos 0x0, ttl 64, id 153, offset 0, flags [none], proto UDP 
(17), length 328) 192.168.1.108.68 > 192.168.1.1.67: [udp sum ok] BOOTP/DHCP, 
Request from 00:16:6f:75:e7:5f, length 300, xid 0x5051a666, Flags [none] 
(0x0000)
          Client-IP 192.168.1.108
          Client-Ethernet-Address 00:16:6f:75:e7:5f
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Release
            Server-ID Option 54, length 4: 192.168.1.1
        0x0000:  4500 0148 0099 0000 4011 f54e c0a8 016c  E..H....@..N...l
        0x0010:  c0a8 0101 0044 0043 0134 c0aa 0101 0600  .....D.C.4......
        0x0020:  5051 a666 0000 0000 c0a8 016c 0000 0000  PQ.f.......l....
        0x0030:  0000 0000 0000 0000 0016 6f75 e75f 0000  ..........ou._..
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 0736  ........c.Sc5..6
        0x0110:  04c0 a801 01ff 0000 0000 0000 0000 0000  ................
        0x0120:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0130:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0140:  0000 0000 0000 0000                      ........

----------------------------------------------------------------------------

>How-To-Repeat:

Use dhcpcd as DHCP client, run `dhcpcd -k' and observe that the lease is not
released on the DHCP server running dnsmasq.

>Fix:

Unicasting DHCPRELEASE messages instead of broadcasting them should fix the
problem.



Home | Main Index | Thread Index | Old Index