mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Timo Teras <timo.teras@iki.fi>
To: musl@lists.openwall.com
Cc: dalias@aerifal.cx, justin@specialbusservice.com
Subject: Re: if_nameindex/getifaddrs and dhcpcd issue
Date: Tue, 8 Apr 2014 19:08:07 +0300	[thread overview]
Message-ID: <20140408190807.7dc6b184@vostro> (raw)
In-Reply-To: <20140408154537.GG26358@brightrain.aerifal.cx>

On Tue, 8 Apr 2014 11:45:37 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> > netlink is here to stay, there's no alternate way to do certain
> > things. So I'd rather use it. It's the interface kernel people
> > intended to be used for the thing in question.  
> 
> As I mentioned on IRC, the current netlink protocol is deficient; my
> understanding is that it's incapable of representing hardware
> addresses longer than a certain fixed length, leading to truncation of
> infiniband addresses. I'm not an expert on this but I seem to remember
> someone (IIRC Rob Landley) knows the details. I'm not sure how fixable
> this is, but it's not a problem at all with a clean text-based
> interface like /proc provides.

Netlink is very extensible. If this is the case they have messed up
some struct that exposes.

glibc has some struct sockaddr_ll_max hack. It is not due to netlink.
It's due to getifaddrs() interface exposing struct sockaddr* and it's
using AF_PACKET that maps to struct sockaddr_ll. struct sockaddr_ll
cannot hold infiniband address, but glibc is 'overriding' the struct to
hold it anyway.

Basically it's getifaddrs() API that is botched,

But as to netlink, all the addresses I've looked at are not wrapped in
struct sockaddr. They are netlink 'attributes' that are variable
length.

The only ABI mess in netlink has been with 32-bit apps running on
64-bit kernels. And it has been kernel header issue.

Please let me know details on the claimed deficiency of netlink. It *a
lot* better (but also a bit complicated - and even more often
misunderstood [because the #define's exposed by kernel to use it is
garbage]) than the the traditional APIs IMHO. The 'on wire' protocol of
netlink is usable though.

> > I'm willing to write an alternative getifaddrs() and if_nameindex()
> > implementations using netlink. Perhaps let's see how they end up?  
> 
> It wouldn't hurt; if they're not upstreamed they could still be used
> as a separate library for the one application which needs this
> functionality (dhcpcd).

Yeah. I'll play with this and see what I come up with. I'll also delete
the bad kernel #define's and try to do them a bit better - not sure how
well I succeed that at, though.


  reply	other threads:[~2014-04-08 16:08 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 [this message]
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
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=20140408190807.7dc6b184@vostro \
    --to=timo.teras@iki.fi \
    --cc=dalias@aerifal.cx \
    --cc=justin@specialbusservice.com \
    --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).