[lkml]   [2001]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19
On Mon, 10 Sep 2001, David Weinehall wrote:

> "[snip] old and the new stuff, please name precisely the objections
> against portability and compatibility with FreeBSD 4.x aliasing."
> ^^^^^^^^^^^^^^^^^^^^
> This is what lead me to my conclusion. Care to clarify? If you simply
> meant SIOCGIFNETMASK, why not write that instead instead of involving
> FreeBSD 4.x?!

Dave, I came up with that because the same piece of code I looked at
choked on Linux 2.4, but not on FreeBSD 4.4-RC. I tracked this down,
fixed it and sent the patch. This can all be read from my posts to the

The issue here is:

1/ Linux returns ALL addresses to SIOCGIFCONF, no matter if these are visible
to SIOCGIFNETMASK or not. Invisible addresses are the second and
subsequent addresses added with ip addr add without using a distinct
label. This means the innocent application that just feeds the
SIOCGIFCONF results into SIOCGIFNETMASK will get the netmask for the
first address. Of course, you can "filter" the addresses through
SIOCGIFADDR and drop the duplicates after that, but why not fix it for
the better?

2/ FreeBSD also uses IP aliases without "logical" interface names such
as eth0:0

3/ FreeBSD returns the netmask for the requested address, Linux returns
the netmask for the first address of the interface.

4/ I sent a patch to enhance the compatibility with "nameless" IP

If you talk about NOT fixing the SIOCG* ioctl API, then fix SIOCGIFCONF
to just return one address per interface regardless how many IPs it
listens to.

But this has all been through. Reread my mails, please.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.086 / U:2.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site