|
Message-ID: <20140408162736.2dd77dfa@ncopa-desktop.alpinelinux.org> Date: Tue, 8 Apr 2014 16:27:36 +0200 From: Natanael Copa <ncopa@...inelinux.org> To: musl@...ts.openwall.com Cc: justin@...cialbusservice.com Subject: Re: if_nameindex/getifaddrs and dhcpcd issue On Tue, 8 Apr 2014 11:07:47 +0100 Justin Cormack <justin@...cialbusservice.com> wrote: > On Tue, Apr 8, 2014 at 10:11 AM, Natanael Copa <ncopa@...inelinux.org> wrote: > > (snip) > > I am not sure that it is appropriate that a netlink implementation, > which is the only way to do the enumeration correctly in the potential > absense of /proc, should go into Musl. I would be more inclined to > implement a new library to do netlink stuff that provides compatible > interfaces (you could use libnetlink too). The glibc implementation is > 723 lines of code, and it is probably hard to make the implementation > a lot smaller, but you could make a full netlink library in not much > more as it is complicated but uniform (I wrote a partly complete one > in 1000 lines of Lua). I believe it can be better done than what glibc does. > However I can see no reason why dhcp on a specified interface needs to > enumerate interfaces at all, and it only needs to read ipv4 addresses, > unless it is implementing dhcp6 too, maybe it does now. Again dhcp6 > needs netlink, the Musl ipv6 parts for getifaddrs already use /proc > which is definitely unreliable for early boot config in a distro in my > view. dhcpcd != dhcp. In any case, i think if_nameindex should return a list of all interfaces, not only those who have a configured ipv4 address. I also think that the way getifaddrs uses /proc for ipv6 is ugly so I'd say that both getifaddrs and if_nameindex would be better off with netlink. -nc
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.