diff options
author | yar <yar@FreeBSD.org> | 2001-06-03 17:31:11 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2001-06-03 17:31:11 +0000 |
commit | 27ef13f896793993f071c86908a1c7a1def39c8d (patch) | |
tree | cb52929c3847127a12f281b4042b9ed37ed5b290 /sys/net | |
parent | 770507fd584ac7a60ae105796bd4936d593c8d1a (diff) | |
download | FreeBSD-src-27ef13f896793993f071c86908a1c7a1def39c8d.zip FreeBSD-src-27ef13f896793993f071c86908a1c7a1def39c8d.tar.gz |
First, wrap the if_up() call into splimp()/splx() because
if_up() must be called at splnet or higher.
Second, set the IFF_RUNNING flag on an interface after its
resources (i.e. tunnel source and destination addresses)
have been set. Note that we don't set IFF_UP because it is
if_up()'s job to do that.
PR: kern/27851
Submitted by: Horacio J. PeÓa <horape@compendium.com.ar>
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_gif.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index f8af910..68031cb 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -401,6 +401,7 @@ gif_ioctl(ifp, cmd, data) struct sockaddr *dst, *src; struct sockaddr *sa; int i; + int s; struct gif_softc *sc2; switch (cmd) { @@ -529,8 +530,10 @@ gif_ioctl(ifp, cmd, data) bcopy((caddr_t)dst, (caddr_t)sa, size); sc->gif_pdst = sa; - ifp->if_flags |= IFF_UP; - if_up(ifp); /* send up RTM_IFINFO */ + ifp->if_flags |= IFF_RUNNING; + s = splimp(); + if_up(ifp); /* mark interface UP and send up RTM_IFINFO */ + splx(s); error = 0; break; |