diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-06-06 09:17:51 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1999-06-06 09:17:51 +0000 |
commit | cf4b937128d88b3491764668c7b5124e4892f0de (patch) | |
tree | 7f39d0721a099c244c3d549dde29905ee799b146 /sys/net/if.c | |
parent | b9569cad6705b1661cda9050ec0e809083265def (diff) | |
download | src-cf4b937128d88b3491764668c7b5124e4892f0de.tar.gz src-cf4b937128d88b3491764668c7b5124e4892f0de.zip |
Introduce IFF_SMART bit.
This means that the driver will add/delete routes when it knows it is
up/down, rather than have the generic code belive it is up if configured.
This is probably most useful for serial lines, although many PHY chips
could probably tell us if we're connected to the cable/hub as well.
Notes
Notes:
svn path=/head/; revision=47777
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index e91445e945ac..3021562a7a9a 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.69 1999/04/27 11:16:56 phk Exp $ + * $Id: if.c,v 1.70 1999/04/28 11:37:32 phk Exp $ */ #include "opt_compat.h" @@ -639,12 +639,15 @@ ifioctl(so, cmd, data, p) if (error) return (error); ifr->ifr_prevflags = ifp->if_flags; - if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) { + if (ifp->if_flags & IFF_SMART) { + /* Smart drivers twiddle their own routes */ + } else if ((ifp->if_flags & IFF_UP && + (ifr->ifr_flags & IFF_UP) == 0) { int s = splimp(); if_down(ifp); splx(s); - } - if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) { + } else if (ifr->ifr_flags & IFF_UP && + (ifp->if_flags & IFF_UP) == 0) { int s = splimp(); if_up(ifp); splx(s); |