[OpenWrt-Devel] [PATCH] netifd: Send DHCP release when client exits

Hans Dedecker dedeckeh at gmail.com
Mon Apr 18 07:51:35 EDT 2016


On Mon, Apr 18, 2016 at 1:22 PM, Bjørn Mork <bjorn at mork.no> wrote:

> Hans Dedecker <dedeckeh at gmail.com> writes:
> > On Sun, Apr 17, 2016 at 2:07 PM, Hauke Mehrtens <hauke at hauke-m.de>
> wrote:
> >
> >> https://www.ietf.org/rfc/rfc2131.txt says in section 3.2 part 4.:
> >>       Note that in this case, where the client retains its network
> >>       address locally, the client will not normally relinquish its
> >>       lease during a graceful shutdown.  Only in the case where the
> >>       client explicitly needs to relinquish its lease, e.g., the client
> >>       is about to be moved to a different subnet, will the client send
> >>       a DHCPRELEASE message.
> >>
> > It's a bit ambiguous to interprete (like so many statements in rfc2131
> :) )
> > as we don't keep the IP address locally when the udhcpc client is
> shutdown.
>
> I don't read it as ambigious at all.
>
> RFC2131 clearly states that the client need not send DHCPRELEASE on
> shutdown.  The exact wording is (twice - both in section 3.1 and 3.2):
>
>      The client may choose to relinquish its lease on a network address
>      by sending a DHCPRELEASE message to the server.
>
> The "may choose" is hard to interprete in any other way than being
> entirely optional.  There is nothing ambigious about that.
>
> So the question boils down to whether automatically sending DHCPRELEASE
> is an advantage or not.  I guess this might depend on your use case, but
> IMHO it is definitely not.  Why would anyone want their address to
> change every time they reboot the system? They don't.
>
 As you mention this depends on the use case and has to be seen in a more
broader network scope; devices in networks which snoop DHCP messages can
hold mac/IP address state info. If the IP address is not being used anymore
by a gateway on a wan interface they want to be informed about this by a
release message so the mac/IP address state can be removed.

>
> I understand that there might be situations where you do want to send
> DHCPRELEASE.  But that is more suitable for an explicit command.  It is
> not something you want to do automatically without having precise
> instructions to do so from the user.
>
> Please do not add this bug to the DHCP client.  Thanks.
>
Making it configurable via UCI and keeping the default behavior will not
introduce a bug

Hans

>
>
>
> Bjørn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160418/40ff87ba/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list