summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2011-07-04 19:24:05 +0000
committersthen <sthen@openbsd.org>2011-07-04 19:24:05 +0000
commitbf6734901c8aba6a23f73483fc42ff1d15214da5 (patch)
tree8545482b155eaa06b26365b9f42d4c38fa5c9783
parentsync (diff)
downloadwireguard-openbsd-bf6734901c8aba6a23f73483fc42ff1d15214da5.tar.xz
wireguard-openbsd-bf6734901c8aba6a23f73483fc42ff1d15214da5.zip
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@
-rw-r--r--sys/net/if_loop.c10
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;