more parts to the ioctls
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 13 Jun 1983 14:09:32 +0000 (06:09 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 13 Jun 1983 14:09:32 +0000 (06:09 -0800)
SCCS-vsn: sys/net/if.c 4.30
SCCS-vsn: sys/net/if.h 4.19

usr/src/sys/net/if.c
usr/src/sys/net/if.h

index 345f32d..3509328 100644 (file)
@@ -1,4 +1,4 @@
-/*     if.c    4.29    83/06/12        */
+/*     if.c    4.30    83/06/12        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -243,10 +243,19 @@ ifioctl(cmd, data)
                ifr->ifr_flags = ifp->if_flags;
                break;
 
                ifr->ifr_flags = ifp->if_flags;
                break;
 
+       case SIOCSIFFLAGS:
+               if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
+                       int s = splimp();
+                       if_down(ifp);
+                       splx(s);
+               }
+               ifp->if_flags = ifr->ifr_flags;
+               break;
+
        default:
                if (ifp->if_ioctl == 0)
                        return (EOPNOTSUPP);
        default:
                if (ifp->if_ioctl == 0)
                        return (EOPNOTSUPP);
-               return ((*ifp->if_ioctl)(cmd, data));
+               return ((*ifp->if_ioctl)(ifp, cmd, data));
        }
        return (0);
 }
        }
        return (0);
 }
index 78dd42f..c1aebb3 100644 (file)
@@ -1,4 +1,4 @@
-/*     if.h    4.18    83/06/12        */
+/*     if.h    4.19    83/06/12        */
 
 /*
  * Structures defining a network interface, providing a packet
 
 /*
  * Structures defining a network interface, providing a packet
@@ -76,6 +76,7 @@ struct ifnet {
 #define        IFF_ROUTE       0x8             /* routing entry installed */
 #define        IFF_POINTOPOINT 0x10            /* interface is point-to-point link */
 #define        IFF_NOTRAILERS  0x20            /* avoid use of trailers */
 #define        IFF_ROUTE       0x8             /* routing entry installed */
 #define        IFF_POINTOPOINT 0x10            /* interface is point-to-point link */
 #define        IFF_NOTRAILERS  0x20            /* avoid use of trailers */
+#define        IFF_RUNNING     0x40            /* resources allocated */
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)