Re: inconsistency between SIOCGIFCONF and SIOCGIFNAME

From: David S. Miller
Date: Wed Jun 30 2004 - 00:16:10 EST


On Tue, 29 Jun 2004 21:45:39 -0700
Ulrich Drepper <drepper@xxxxxxxxxx> wrote:

> When was the netlink interface introduced? The ioctl() code is most
> probably older and therefore we would still get wrong results on old
> kernels. I don't know the reason why you hesitate, but the patch seems
> really harmless and, as you pointed out, more compatible with the BSD
> version.

RTNETLINK interfaces to get link information has existed since at
least 2.0.x or something :-) In fact, the first RTNETLINK codes
are the ones to obtain and set link information.

All of these BSD ioctls are deprecated interfaces, back compatability
hacks if you real, and the recommended interface to change link and
route information is RTNETLINK.

I really hesitate to change the ioctl() code, because basically my
suggested change puts effectively an AF_UNSPEC address there (this
is what you get with a zero'd out sockaddr_t). Who knows what that
means. Sure most apps will ignore it but I absolutely do not want
to take the chance.

This is especially unnecessary since rtnetlink does exactly what you
want already, so we don't need to add a new interface nor change the
semantics of an old one.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/