SIOCGIFCONF handling in recent 2.1 kernels

baccala@FreeSoft.org
Wed, 15 Apr 1998 16:09:47 -0400 (EDT)


Hi -

I've got a problem trying to port ISC's DHCP client to Linux 2.1.x.

The code does an ioctl(SIOCGIFCONF) to find the list of all valid
interfaces on the system. Unfortunately, it does this before the
interfaces are configured for IP (obviously, since DHCP is about to try
to config IP), and the only thing that gets returned is the loopback.

Looking through the kernel source, I see dev_ifconf() in net/core/dev.c,
which seems to handle the ioctl by looping through a set of "gifconf"s,
each of which have been setup by calling register_gifconf(), also in
net/core/dev.c. The only place in the whole tree I see
register_gifconf called is from net/ipv4/devinet.c, which seems to
suggest that SIOCGIFCONF will only return interfaces for which IP has
been configured.

Not really the behavior the code wants, and apparently not really the
behavior of most other UNIX varients, judging from the lack of #ifdefs
in this portion of a program that runs on about a dozen UNIX flavors.

So what's the deal? Any POSIX gurus out there with "the law"?

-- 
					-bwb

Brent Baccala baccala@FreeSoft.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu