From 20e879f90c1286c590850edc3306fb09792547e3 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Mon, 1 Jun 2020 08:59:06 -0400 Subject: [PATCH] zebra: include dest addr when deleting p2p from interface When deleting a p2p address from an interface, include the destination address. Without this, we don't find the internal connected datastruct and process the delete correctly on netlink OSes. Signed-off-by: Mark Stapp --- zebra/if_netlink.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index c743011224..7677db7efd 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1121,16 +1121,23 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) nl_msg_type_to_str(h->nlmsg_type)); return -1; } + if (h->nlmsg_type == RTM_NEWADDR) connected_add_ipv4(ifp, flags, (struct in_addr *)addr, ifa->ifa_prefixlen, (struct in_addr *)broad, label, metric); - else + else if (CHECK_FLAG(flags, ZEBRA_IFA_PEER)) { + /* Delete with a peer address */ + connected_delete_ipv4( + ifp, flags, (struct in_addr *)addr, + ifa->ifa_prefixlen, broad); + } else connected_delete_ipv4( ifp, flags, (struct in_addr *)addr, ifa->ifa_prefixlen, NULL); } + if (ifa->ifa_family == AF_INET6) { if (ifa->ifa_prefixlen > IPV6_MAX_BITLEN) { zlog_err( -- 2.39.5