[dev] [sdhcp] The problem with renewals

From: Sean MacLennan <seanm_AT_seanm.ca>
Date: Tue, 10 Mar 2020 19:37:41 -0400

I found a couple of bugs in sdhcp... both having to do with
renewal. If you are having problems renewing your lease or find that
your IP keeps changing... read on.

The first problem is that sdhcp assumes the renew and rebind times
will be set. These fields are optional, only the lease time is
required. So you may end up never timing out until the lease
expires. This can cause you to lose your IP depending on the server.

Because the optget() is a relatively expensive call, it is actually
cheaper to calculate the times every time. I have attached a patch
that does this.

The second problem is the server IP. sdhcp assumes that the server id
(ODserverid) is the IP of the server. This is not always the case. It
seems that the only safe IP is the address from the recvfrom().

Currently sdhcp ignores this value, but it should set server IP to
this. I don't have a patch for this since the suckless sdhcp and my
sdhcp have diverged a lot here. If you ask nicely I might roll up a
patch.

All the ODserverid code should be safe to remove.

Cheers,
   Sean

Received on Wed Mar 11 2020 - 00:37:41 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 14 2020 - 22:12:08 CET