diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2011-07-04 19:24:06 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2011-07-04 19:24:06 +0000 |
commit | 2996db47911b2cd765f62a0dd251d8cb0195b3d5 (patch) | |
tree | 12dcdf25e119b8a60084d725311addcb4ad237ad /sys | |
parent | 2a4338a58ebf84f7d4795c6b4854f5aa6bc3b399 (diff) |
make sure RTM_IFINFO is sent when lo(4) handles SIOCSIFADDR; without this
ospfd doesn't notice an interface added at runtime unless you ifconfig down+up.
ok phessler@ claudio@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_loop.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 195f3cefc59..a5063825c43 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_loop.c,v 1.44 2008/05/07 12:58:54 norby Exp $ */ +/* $OpenBSD: if_loop.c,v 1.45 2011/07/04 19:24:05 sthen Exp $ */ /* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */ /* @@ -423,12 +423,16 @@ loioctl(ifp, cmd, data) { struct ifaddr *ifa; struct ifreq *ifr; - int error = 0; + int s, error = 0; switch (cmd) { case SIOCSIFADDR: - ifp->if_flags |= IFF_UP | IFF_RUNNING; + s = splnet(); + ifp->if_flags |= IFF_RUNNING; + if_up(ifp); /* send up RTM_IFINFO */ + splx(s); + ifa = (struct ifaddr *)data; if (ifa != 0) ifa->ifa_rtrequest = lortrequest; |