diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
commit | 13f4c340aeeeb104844712bb36899d1adef50579 (patch) | |
tree | bb70e59641e2310a3c26ec449af5ab0cb7420d9d /sys/net/if_tun.c | |
parent | 292ee7be1c404a624dda68ddff1bd988a1851e5a (diff) | |
download | src-13f4c340aeeeb104844712bb36899d1adef50579.tar.gz src-13f4c340aeeeb104844712bb36899d1adef50579.zip |
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags. Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags. This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.
Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.
Reviewed by: pjd, bz
MFC after: 7 days
Notes
Notes:
svn path=/head/; revision=148887
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index d9c31e2ed11b..eafcdb569965 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -360,7 +360,7 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td) splx(s); } - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; s = splimp(); @@ -370,7 +370,7 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td) /* Unlocked read. */ rtinit(ifa, (int)RTM_DELETE, tp->tun_flags & TUN_DSTADDR ? RTF_HOST : 0); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); } @@ -389,7 +389,8 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "tuninit\n"); - ifp->if_flags |= IFF_UP | IFF_RUNNING; + ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; |