Date: Tue, 8 Apr 2014 18:59:32 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: if_nameindex/getifaddrs and dhcpcd issue On Tue, Apr 08, 2014 at 10:30:34PM +0100, Justin Cormack wrote: > On Tue, Apr 8, 2014 at 10:16 PM, Natanael Copa <ncopa@...inelinux.org> wrote: > > It looks like the reason for this is that you can provide a wilcard, eg > > 'eth*' and it will monitor all interfaces that fnmatches that. > > > >> The other case, where no interface is specified on the command line > >> and dhcpcd tries all interfaces, is buggy usage by the caller. There > >> are all sorts of interfaces that might exist, unconfigured, and which > >> might not be appropriate to send dhcpc requests on. I assume dhcpcd > >> has some heuristics to avoid selecting things like unconfigured > >> tunnel, slip, etc. interfaces but if so that's just an ugly hack. The > >> operation of "try all instances of a given type of resource" is just > >> wrong by design. > > > > Yes you can configure a list of exact interfaces that you want dhcpcd > > to monitor or you can have a black list - with wilcards. > > > > See allowinterfaces and denyinterfaces (which also can be specified on > > command line) http://roy.marples.name/man/html5/dhcpcd.conf.html > > > > dhcpcd is more an ifplugd + dhcp client wit optional support for dbus. > > It can also get notifications from wpa_supplicant. You can even have > > dhcpcd to set static ip addresses. So its more an alternative to > > NetworkManager than to udhcpc. > > > > Other thing it can handle is currently unknown interfaces. For example > > the laptop I use right now does not have any ethernet port, only wifi. > > I do have an ethernet USB adapter. So eth0 is not there at bootup. I > > currently get error messages on screen due to udhcpc does not find the > > configured eth0 interface. > > > > To solve this, without needing install the full NetworkManager suite or > > systemds networkd, I can simply let dhcpcd run in manager mode, and it > > will run the show. There is even a dhcpcd-ui applet that gives me link > > status etc on my desktop. > > Sounds like the sort of design that should have netlink built into it > then. You can do all sorts of useful things then, like listen on a > netlink socket for new interfaces being created. Yes. The above explanation of dhcpcd makes it clear what it's enumerating interfaces for, but also suggests it should be using netlink entirely rather than libc to avoid TOCTOU races on device insertion/removal. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.