public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* inconsistency between SIOCGIFCONF and SIOCGIFNAME
@ 2004-06-29  4:06 Ulrich Drepper
  2004-06-29  8:26 ` David S. Miller
  2004-06-29 16:32 ` Stephen Hemminger
  0 siblings, 2 replies; 12+ messages in thread
From: Ulrich Drepper @ 2004-06-29  4:06 UTC (permalink / raw)
  To: Linux Kernel

POSIX does not specify the if_indextoname and if_nameindex functions,
they are only vaguely specified in an RFC.  So there is some room for
interpretation but still I think it is an issue.

If SIOCGIFCONF to query the system's interfaces only active interfaces
are returned.  But SIOCGIFNAME (and SIOCGIFINDEX) allow querying
interfaces which are down and not fully initialized.

RFC 3493 says if_nameindex should return *all* interfaces.  This means
that neither if_indextoname or if_nametoindex (defined in the same rfc)
should define more interfaces.


With the current kernels all I could do is to make if_indextoname and
if_nametoindex slower by always calling if_nameindex implicitly to see
whether the interface is defined at all.  It would be much better if the
kernel could do the right thing.  I.e., do one of the following:

~ if the SIOCGIFCONF, return all interfaces SIOCGIFNAME also knows
  about.

~ do not allow SIOCGIFNAME and SIOCGIFINDEX) to return values if
  SIOCGIFCONF, would not return any.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-06-30 20:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29  4:06 inconsistency between SIOCGIFCONF and SIOCGIFNAME Ulrich Drepper
2004-06-29  8:26 ` David S. Miller
2004-06-29 16:22   ` Ulrich Drepper
2004-06-29 19:09   ` Ulrich Drepper
2004-06-29 21:19     ` David S. Miller
2004-06-30  4:45       ` Ulrich Drepper
2004-06-30  5:10         ` YOSHIFUJI Hideaki / 吉藤英明
2004-06-30  5:13         ` David S. Miller
2004-06-30  7:51           ` Ulrich Drepper
2004-06-30 19:59             ` David S. Miller
2004-06-29 16:32 ` Stephen Hemminger
2004-06-29 19:11   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox