summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-10-17 19:40:44 +0000
committerjlemon <jlemon@FreeBSD.org>2001-10-17 19:40:44 +0000
commit85e1c0879143bd206c275035a79c73a212654cfa (patch)
tree48c6a8b547edcdd9d4d3efc68bc8d9880786c0e3 /sys/net/if.c
parentae7cec463fe49996e919eb79d6b94c2ececcb688 (diff)
downloadFreeBSD-src-85e1c0879143bd206c275035a79c73a212654cfa.zip
FreeBSD-src-85e1c0879143bd206c275035a79c73a212654cfa.tar.gz
Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.
This will be used to more efficiently support if_nametoindex(3).
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 2728141..7ffb296 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1145,6 +1145,10 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
ifr = (struct ifreq *)data;
switch (cmd) {
+ case SIOCGIFINDEX:
+ ifr->ifr_index = ifp->if_index;
+ break;
+
case SIOCGIFFLAGS:
ifr->ifr_flags = ifp->if_flags;
break;
OpenPOWER on IntegriCloud