aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/net.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-01-16 12:01:36 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-01-16 12:01:36 +0000
commit835fc32a3ae2bfcbb7c4b16dbbe3fc5906fd99d1 (patch)
treeaba7a98c444702f9fce0a5ec0b35bb2649c534d3 /winsup/cygwin/net.cc
parent2fd167e6de34199a834a88a5d61a7b67e3a0d6c9 (diff)
downloadnewlib-835fc32a3ae2bfcbb7c4b16dbbe3fc5906fd99d1.zip
newlib-835fc32a3ae2bfcbb7c4b16dbbe3fc5906fd99d1.tar.gz
newlib-835fc32a3ae2bfcbb7c4b16dbbe3fc5906fd99d1.tar.bz2
* fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.
* net.cc (get_2k_ifconf): Ditto. (get_nt_ifconf): Fake SIOCGIFINDEX. (get_95_ifconf): Ditto. (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems not supporting IP Helper Lib. * include/asm/socket.h (SIOCGIFINDEX): Define. * include/cygwin/if.h (struct ifreq): Add member for interface index. (ifr_ifindex): Define.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index f70618d..13a1ee9 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1299,6 +1299,9 @@ get_2k_ifconf (struct ifconf *ifc, int what)
case SIOCGIFMTU:
ifr->ifr_mtu = ifrow->dwMtu;
break;
+ case SIOCGIFINDEX:
+ ifr->ifr_ifindex = ifrow->dwIndex;
+ break;
}
++cnt;
if ((caddr_t)++ ifr >
@@ -1461,6 +1464,9 @@ get_nt_ifconf (struct ifconf *ifc, int what)
case SIOCGIFMTU:
ifr->ifr_mtu = 1500;
break;
+ case SIOCGIFINDEX:
+ ifr->ifr_ifindex = -1;
+ break;
}
}
else
@@ -1503,6 +1509,9 @@ get_nt_ifconf (struct ifconf *ifc, int what)
case SIOCGIFMTU:
ifr->ifr_mtu = 1500;
break;
+ case SIOCGIFINDEX:
+ ifr->ifr_ifindex = -1;
+ break;
}
}
++cnt;
@@ -1638,6 +1647,9 @@ get_95_ifconf (struct ifconf *ifc, int what)
case SIOCGIFMTU:
ifr->ifr_mtu = 1500;
break;
+ case SIOCGIFINDEX:
+ ifr->ifr_ifindex = -1;
+ break;
}
}
@@ -1747,6 +1759,9 @@ get_ifconf (struct ifconf *ifc, int what)
/* Default value for MS TCP Loopback interface. */
ifr->ifr_mtu = 1520;
break;
+ case SIOCGIFINDEX:
+ ifr->ifr_ifindex = -1;
+ break;
default:
set_errno (EINVAL);
return -1;