diff options
author | emax <emax@FreeBSD.org> | 2004-08-11 00:12:27 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2004-08-11 00:12:27 +0000 |
commit | 6e0dfecf1ce6d354529806b8fb8ba85cafa273ed (patch) | |
tree | a8fb4219a0b085ab78cbb3e18aed16fb73c0b545 /sys/net/if_tap.c | |
parent | bea97d03fe2d173125817e1ef83dcd1746749b94 (diff) | |
download | FreeBSD-src-6e0dfecf1ce6d354529806b8fb8ba85cafa273ed.zip FreeBSD-src-6e0dfecf1ce6d354529806b8fb8ba85cafa273ed.tar.gz |
Set IFF_RUNNING flag on the interface as soon as the control device is opened.
Diffstat (limited to 'sys/net/if_tap.c')
-rw-r--r-- | sys/net/if_tap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 7eb4ac0..6bda09d 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -340,7 +340,8 @@ tapopen(dev, flag, mode, td) struct thread *td; { struct tap_softc *tp = NULL; - int error; + struct ifnet *ifp = NULL; + int error, s; if ((error = suser(td)) != 0) return (error); @@ -368,10 +369,15 @@ tapopen(dev, flag, mode, td) bcopy(tp->arpcom.ac_enaddr, tp->ether_addr, sizeof(tp->ether_addr)); tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; + ifp = &tp->tap_if; mtx_unlock(&tp->tap_mtx); - TAPDEBUG("%s is open. minor = %#x\n", - tp->tap_if.if_xname, minor(dev)); + s = splimp(); + ifp->if_flags |= IFF_RUNNING; + ifp->if_flags &= ~IFF_OACTIVE; + splx(s); + + TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev)); return (0); } /* tapopen */ |