From 56e7e3f65ab4653f41c2d0ef456044c2044ff529 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 18 Mar 2021 15:55:19 +0000 Subject: [PATCH] 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@ --- sys/net/rtsock.c | 9 ++++++--- 1 file 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); } -- 2.20.1