Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet allow AF_UNSPEC for SIOCDIFADDR. ISC DHCP clien...



details:   https://anonhg.NetBSD.org/src/rev/f753f972e80a
branches:  trunk
changeset: 482921:f753f972e80a
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Feb 25 08:51:35 2000 +0000

description:
allow AF_UNSPEC for SIOCDIFADDR.  ISC DHCP client depends on this behavior.

diffstat:

 sys/netinet/in.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r f59f0f6d1ed0 -r f753f972e80a sys/netinet/in.c
--- a/sys/netinet/in.c  Fri Feb 25 08:37:05 2000 +0000
+++ b/sys/netinet/in.c  Fri Feb 25 08:51:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.53 2000/02/25 08:37:05 itojun Exp $   */
+/*     $NetBSD: in.c,v 1.54 2000/02/25 08:51:35 itojun Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -361,11 +361,20 @@
                                    ifra->ifra_addr.sin_addr))
                                        break;
                        }
-               if (cmd == SIOCDIFADDR && ia == 0)
-                       return (EADDRNOTAVAIL);
+               if (cmd == SIOCDIFADDR) {
+                       if (ia == 0)
+                               return (EADDRNOTAVAIL);
+#ifdef COMPAT_43
+                       if (ifra->ifra_addr.sin_family == AF_UNSPEC)
+                               ifra->ifra_addr.sin_family = AF_INET;
+#endif
+               }
                /* FALLTHROUGH */
        case SIOCSIFADDR:
        case SIOCSIFDSTADDR:
+               if (ifra->ifra_addr.sin_family != AF_INET)
+                       return (EAFNOSUPPORT);
+               /* FALLTHROUGH */
        case SIOCSIFNETMASK:
                if (ifp == 0)
                        panic("in_control");



Home | Main Index | Thread Index | Old Index