summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2021-03-18 15:55:19 +0000
committerclaudio <claudio@openbsd.org>2021-03-18 15:55:19 +0000
commit56e7e3f65ab4653f41c2d0ef456044c2044ff529 (patch)
tree17d96a4b82db3e0de67e74cb2e1da7839057282b
parentFail in rsync_base_uri() if the strdup calls fail. Do not bubble this (diff)
downloadwireguard-openbsd-56e7e3f65ab4653f41c2d0ef456044c2044ff529.tar.xz
wireguard-openbsd-56e7e3f65ab4653f41c2d0ef456044c2044ff529.zip
Like in the sysctl case include the ifp_sadl as RTA_IFP address in RTM_IFINFO
messages. This way userland can detect if the lladdr of an interface was changed. OK florian@ bluhm@
-rw-r--r--sys/net/rtsock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 6fb80d9e4da..71340f8cfdc 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.307 2021/02/27 11:44:48 mvs Exp $ */
+/* $OpenBSD: rtsock.c,v 1.308 2021/03/18 15:55:19 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -1708,12 +1708,15 @@ rtm_miss(int type, struct rt_addrinfo *rtinfo, int flags, uint8_t prio,
void
rtm_ifchg(struct ifnet *ifp)
{
+ struct rt_addrinfo info;
struct if_msghdr *ifm;
struct mbuf *m;
if (rtptable.rtp_count == 0)
return;
- m = rtm_msg1(RTM_IFINFO, NULL);
+ memset(&info, 0, sizeof(info));
+ info.rti_info[RTAX_IFP] = sdltosa(ifp->if_sadl);
+ m = rtm_msg1(RTM_IFINFO, &info);
if (m == NULL)
return;
ifm = mtod(m, struct if_msghdr *);
@@ -1722,7 +1725,7 @@ rtm_ifchg(struct ifnet *ifp)
ifm->ifm_flags = ifp->if_flags;
ifm->ifm_xflags = ifp->if_xflags;
if_getdata(ifp, &ifm->ifm_data);
- ifm->ifm_addrs = 0;
+ ifm->ifm_addrs = info.rti_addrs;
route_input(m, NULL, AF_UNSPEC);
}