mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: if_nameindex/getifaddrs and dhcpcd issue
Date: Tue, 8 Apr 2014 18:59:32 -0400	[thread overview]
Message-ID: <20140408225932.GI26358@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAK4o1WxVZ+OQiTCEqsBoJLUC7hd13j80SYSDY4doHbXtRfaBHw@mail.gmail.com>

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@alpinelinux.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


  reply	other threads:[~2014-04-08 22:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  9:11 Natanael Copa
2014-04-08 10:07 ` Justin Cormack
2014-04-08 12:25   ` Timo Teras
2014-04-08 14:23     ` Natanael Copa
2014-04-08 15:45     ` Rich Felker
2014-04-08 16:08       ` Timo Teras
2014-04-08 16:19         ` Justin Cormack
2014-04-08 22:41           ` Rich Felker
2014-04-09  7:17             ` u-igbb
2014-04-09 22:20               ` Rich Felker
2014-04-09 22:32                 ` Justin Cormack
2014-04-10  7:40                 ` u-igbb
2014-04-10  7:52                   ` Rich Felker
2014-04-09 14:02         ` Timo Teras
2014-04-10  0:55           ` Rich Felker
2014-04-09  7:55       ` Natanael Copa
2014-04-08 12:54   ` Szabolcs Nagy
2014-04-08 13:42   ` Rich Felker
2014-04-08 14:16     ` Justin Cormack
2014-04-08 15:38       ` Rich Felker
2014-04-09  7:13         ` Natanael Copa
2014-04-09 22:18           ` Rich Felker
2014-04-08 21:16     ` Natanael Copa
2014-04-08 21:30       ` Justin Cormack
2014-04-08 22:59         ` Rich Felker [this message]
2014-04-08 14:27   ` Natanael Copa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140408225932.GI26358@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).