diff options
author | phk <phk@FreeBSD.org> | 1999-02-19 13:41:35 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-02-19 13:41:35 +0000 |
commit | 79b9e4e72513965017026325591cc1c2b139deb2 (patch) | |
tree | 01e97d9b9c8b68225a7326ab88a31c66717b75e1 /sys/net | |
parent | f9df03b8e8894cd25d4c86b52125d71c79f0de96 (diff) | |
download | FreeBSD-src-79b9e4e72513965017026325591cc1c2b139deb2.zip FreeBSD-src-79b9e4e72513965017026325591cc1c2b139deb2.tar.gz |
Since ifru_flags is a short, we can fit in a copy of the flags
before they got changed. This can help eliminate much of the
gymnastics drivers do in their ioctl routines to figure this out.
Remove commented out IFF_NOTRAILERS
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 3 | ||||
-rw-r--r-- | sys/net/if.h | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index da7c495..680bbd4 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.64 1998/12/16 18:30:42 phk Exp $ + * $Id: if.c,v 1.65 1999/02/01 20:03:27 phk Exp $ */ #include "opt_compat.h" @@ -604,6 +604,7 @@ ifioctl(so, cmd, data, p) error = suser(p->p_ucred, &p->p_acflag); if (error) return (error); + ifr->ifr_prevflags = ifp->if_flags; if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) { int s = splimp(); if_down(ifp); diff --git a/sys/net/if.h b/sys/net/if.h index 32b5166..e4f0046 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id: if.h,v 1.48 1998/01/13 02:56:21 wollman Exp $ + * $Id: if.h,v 1.49 1998/03/21 13:36:20 peter Exp $ */ #ifndef _NET_IF_H_ @@ -82,7 +82,6 @@ struct if_data { #define IFF_DEBUG 0x4 /* turn on debugging */ #define IFF_LOOPBACK 0x8 /* is a loopback net */ #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ -/*#define IFF_NOTRAILERS 0x20 * obsolete: avoid use of trailers */ #define IFF_RUNNING 0x40 /* resources allocated */ #define IFF_NOARP 0x80 /* no address resolution protocol */ #define IFF_PROMISC 0x100 /* receive all packets */ @@ -157,7 +156,7 @@ struct ifreq { struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; - short ifru_flags; + short ifru_flags[2]; int ifru_metric; int ifru_mtu; int ifru_phys; @@ -167,7 +166,8 @@ struct ifreq { #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ -#define ifr_flags ifr_ifru.ifru_flags /* flags */ +#define ifr_flags ifr_ifru.ifru_flags[0] /* flags */ +#define ifr_prevflags ifr_ifru.ifru_flags[1] /* flags */ #define ifr_metric ifr_ifru.ifru_metric /* metric */ #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ |