]> git.puffer.fish Git - matthieu/frr.git/commitdiff
nhrp: fix race condition
authorLou Berger <lberger@labn.net>
Tue, 6 Feb 2024 23:14:07 +0000 (23:14 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 9 Feb 2024 15:58:18 +0000 (15:58 +0000)
where null lladdr recieved from zebra before nhrp next hop
is installed.

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 5d9ebe61815814804fac39597578c57e6420a69c)

nhrpd/netlink_arp.c

index 2e22f8e247a7f3b28d90cc4cffc6007366bb0dcd..d44408a2fce2ffca9cbde96c228699dbaa4e0973 100644 (file)
@@ -184,6 +184,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.
                         */