Source-Changes-HG archive

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

[src/trunk]: src/sys/net Use if_mcast_op() and if_flags_set() instead of call...



details:   https://anonhg.NetBSD.org/src/rev/4b4657b5635f
branches:  trunk
changeset: 770499:4b4657b5635f
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Wed Oct 19 01:48:30 2011 +0000

description:
Use if_mcast_op() and if_flags_set() instead of calling ifp->if_ioctl().

diffstat:

 sys/net/if_vlan.c |  35 +++++++++++++++--------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diffs (63 lines):

diff -r 36240a50d980 -r 4b4657b5635f sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Wed Oct 19 01:46:43 2011 +0000
+++ b/sys/net/if_vlan.c Wed Oct 19 01:48:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.67 2011/04/08 13:56:51 sborrill Exp $    */
+/*     $NetBSD: if_vlan.c,v 1.68 2011/10/19 01:48:30 dyoung Exp $      */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.67 2011/04/08 13:56:51 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.68 2011/10/19 01:48:30 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -469,24 +469,6 @@
        s = splnet();
 
        switch (cmd) {
-       case SIOCINITIFADDR:
-               if (ifv->ifv_p != NULL) {
-                       ifp->if_flags |= IFF_UP;
-
-                       switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
-                       case AF_INET:
-                               arp_ifinit(ifp, ifa);
-                               break;
-#endif
-                       default:
-                               break;
-                       }
-               } else {
-                       error = EINVAL;
-               }
-               break;
-
        case SIOCSIFMTU:
                if (ifv->ifv_p == NULL)
                        error = EINVAL;
@@ -569,6 +551,19 @@
                if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
                        error = 0;
                break;
+       case SIOCINITIFADDR:
+               if (ifv->ifv_p == NULL) {
+                       error = EINVAL;
+                       break;
+               }
+
+               ifp->if_flags |= IFF_UP;
+#ifdef INET
+               if (ifa->ifa_addr->sa_family == AF_INET)
+                       arp_ifinit(ifp, ifa);
+#endif
+               break;
+
        default:
                error = ether_ioctl(ifp, cmd, data);
        }



Home | Main Index | Thread Index | Old Index