Source-Changes-HG archive

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

[src/netbsd-2]: src/sys/netinet Pull up following revision(s) (requested by s...



details:   https://anonhg.NetBSD.org/src/rev/9bdd8401c87d
branches:  netbsd-2
changeset: 564449:9bdd8401c87d
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Apr 02 17:48:13 2006 +0000

description:
Pull up following revision(s) (requested by seanb in ticket #10411):
        sys/netinet/in.c: revision 1.105
- Close NULL dereference when a GIFALIAS is performed on
  a non existant address.
- Code review: christos

diffstat:

 sys/netinet/in.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 957ee4882e04 -r 9bdd8401c87d sys/netinet/in.c
--- a/sys/netinet/in.c  Thu Mar 30 15:31:12 2006 +0000
+++ b/sys/netinet/in.c  Sun Apr 02 17:48:13 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.93.2.1 2004/07/10 12:42:37 tron Exp $ */
+/*     $NetBSD: in.c,v 1.93.2.1.2.1 2006/04/02 17:48:13 riz Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.93.2.1 2004/07/10 12:42:37 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.93.2.1.2.1 2006/04/02 17:48:13 riz Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet_conf.h"
@@ -355,14 +355,15 @@
                                    ifra->ifra_addr.sin_addr))
                                        break;
                        }
-               if (cmd == SIOCDIFADDR) {
-                       if (ia == 0)
-                               return (EADDRNOTAVAIL);
+               if ((cmd == SIOCDIFADDR || cmd == SIOCGIFALIAS) && ia == NULL)
+                       return (EADDRNOTAVAIL);
+
 #if 1 /*def COMPAT_43*/
-                       if (ifra->ifra_addr.sin_family == AF_UNSPEC)
-                               ifra->ifra_addr.sin_family = AF_INET;
+               if (cmd == SIOCDIFADDR &&
+                   ifra->ifra_addr.sin_family == AF_UNSPEC) {
+                       ifra->ifra_addr.sin_family = AF_INET;
+               }
 #endif
-               }
                /* FALLTHROUGH */
        case SIOCSIFADDR:
        case SIOCSIFDSTADDR:



Home | Main Index | Thread Index | Old Index