Page MenuHomeFreeBSD

D667.id1204.diff
No OneTemporary

D667.id1204.diff

Index: sys/netinet/in.c
===================================================================
--- sys/netinet/in.c
+++ sys/netinet/in.c
@@ -213,6 +213,8 @@
case SIOCGIFBRDADDR:
case SIOCGIFDSTADDR:
case SIOCGIFNETMASK:
+ /* Legacy ioctls */
+ addr->sin_addr.s_addr = INADDR_ANY;
break;
case SIOCDIFADDR:
sx_xlock(&in_control_sx);
@@ -242,15 +244,16 @@
return (EADDRNOTAVAIL);
/*
- * For SIOCGIFADDR, pick the first address. For the rest of
- * ioctls, try to find specified address.
+ * Find address for this interface, if it exists. If an
+ * address was specified, find that one instead of the
+ * first one on the interface, if possible.
*/
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = (struct in_ifaddr *)ifa;
- if (cmd == SIOCGIFADDR || addr->sin_addr.s_addr == INADDR_ANY)
+ if (addr->sin_addr.s_addr == INADDR_ANY)
break;
if (ia->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr)
break;

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 13, 12:47 AM (7 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38827229
Default Alt Text
D667.id1204.diff (1 KB)

Event Timeline