System doesn't detect unplugged network cable and doesn't set interface up properly with DHCP

John Baldwin jhb at freebsd.org
Mon Aug 20 12:31:43 UTC 2012


On Friday, August 17, 2012 6:58:58 pm Peter Jeremy wrote:
> On 2012-Aug-17 11:48:17 -0400, John Baldwin <jhb at freebsd.org> wrote:
> >Hmm, I think I see the issue.  It doesn't export the existing lease info to
> >the script when running the FAIL action.  I just tested this change and it
> >removed the old IP on my laptop when I tested it just now.
> 
> I did some investigating during the week and came to pretty much the
> same patch.  But the existing "don't remove an existing address"
> behaviour looked like a design decision and I went digging to find
> exactly what ip->client->active represented - and, in particular,
> whether in could represent an address that dhclient hadn't added to
> the interface.  I did find that it could be read from the leases file
> but didn't have time to fully work through the code.
> 
> If you're happy that this patch can't incorrectly remove a pre-existing
> IP address (I'm now reasonably confident that it can't), then I'm happy
> that it otherwise works.

I think it should be fine.  It's a bit hard to infer exactly what the desired
design is from OpenBSD's dhclient code now as it uses a different tack (they
don't restart dhclient on link up, but leave the dhclient hanging around and
it restarts its own state when the link goes up).

-- 
John Baldwin


More information about the freebsd-net mailing list