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>
This commit is contained in:
yar 2001-06-03 17:31:11 +00:00
parent da10e53f10
commit a8290c2add

View File

@ -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;