From 5d9ebe61815814804fac39597578c57e6420a69c Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 6 Feb 2024 23:14:07 +0000 Subject: nhrp: fix race condition where null lladdr recieved from zebra before nhrp next hop is installed. Signed-off-by: Lou Berger --- nhrpd/netlink_arp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nhrpd/netlink_arp.c') diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c index 88628999a..be909c862 100644 --- a/nhrpd/netlink_arp.c +++ b/nhrpd/netlink_arp.c @@ -191,6 +191,11 @@ int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS) "Netlink: update binding for %pSU dev %s from c %pSU peer.vc.nbma %pSU to lladdr %pSU", &addr, ifp->name, &c->cur.remote_nbma_natoa, &c->cur.peer->vc->remote.nbma, &lladdr); + + if (lladdr.sa.sa_family == AF_UNSPEC) + /* nothing from zebra, so use nhrp peer */ + lladdr = c->cur.peer->vc->remote.nbma; + /* In case of shortcuts, nbma is given by lladdr, not * vc->remote.nbma. */ -- cgit v1.2.3