diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-01-04 13:11:27 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-01-04 13:11:27 +0300 |
commit | bcdf742178d44fde6208e5687858ee409737966d (patch) | |
tree | 76b97f53906fedb990ce6515f739ba579a6b5e1d /winsup/cygwin/fhandler_socket.cc | |
parent | 7bef7db5ccd9c68f28ba541cb9a7bb0b15641945 (diff) |
* fhandler_socket.cc (fhandler_socket::ioctl): Don't fake results
for SIOCGIFFLAGS here. Call get_ifconf instead.
* net.cc (get_2k_ifconf): Clean up code to generate interface name.
Handle SIOCGIFFLAGS here.
(get_nt_ifconf): Fake SIOCGIFFLAGS here.
(get_95_ifconf): Ditto.
(get_ifconf): Don't fake loopback on systems with IP Helper Lib.
Set MTU for loopback to a more "modern" value.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 0fecdaaac..3f7799eec 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1,6 +1,6 @@ /* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes. - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. This file is part of Cygwin. @@ -1413,21 +1413,6 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) debug_printf ("error in get_ifconf"); break; case SIOCGIFFLAGS: - ifr = (struct ifreq *) p; - if (ifr == 0) - { - set_errno (EINVAL); - return -1; - } - ifr->ifr_flags = IFF_NOTRAILERS | IFF_UP | IFF_RUNNING; - if (!strncmp(ifr->ifr_name, "lo", 2) - || ntohl (((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr) - == INADDR_LOOPBACK) - ifr->ifr_flags |= IFF_LOOPBACK; - else - ifr->ifr_flags |= IFF_BROADCAST; - res = 0; - break; case SIOCGIFBRDADDR: case SIOCGIFNETMASK: case SIOCGIFADDR: @@ -1463,6 +1448,9 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) { switch (cmd) { + case SIOCGIFFLAGS: + ifr->ifr_flags = ifrp->ifr_flags; + break; case SIOCGIFADDR: ifr->ifr_addr = ifrp->ifr_addr; break; |