summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2021-03-18 15:58:58 +0000
committerclaudio <claudio@openbsd.org>2021-03-18 15:58:58 +0000
commit18111dbb2624eff318ba78ee0522f99a15c00dd2 (patch)
tree3be11efa86aeb8a979a1fde0687ad0047240b54f
parentDo not call rtm_ifchg() if IFF_UP changed. The code in if_up() and if_down() (diff)
downloadwireguard-openbsd-18111dbb2624eff318ba78ee0522f99a15c00dd2.tar.xz
wireguard-openbsd-18111dbb2624eff318ba78ee0522f99a15c00dd2.zip
When changing the link local address send a RTM_IFINFO message out.
Also prefer if (error == 0) over if (!error). OK florian@ bluhm@
-rw-r--r--sys/net/if.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 72a25fb7932..0da3720b838 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.637 2021/03/18 15:57:16 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.638 2021/03/18 15:58:58 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -2071,7 +2071,7 @@ forceup:
NET_LOCK();
error = (*ifp->if_ioctl)(ifp, cmd, data);
NET_UNLOCK();
- if (!error)
+ if (error == 0)
rtm_ifchg(ifp);
break;
@@ -2172,6 +2172,8 @@ forceup:
if (error == 0)
ifnewlladdr(ifp);
NET_UNLOCK();
+ if (error == 0)
+ rtm_ifchg(ifp);
break;
case SIOCSIFLLPRIO: