network: neighbor: Always add neighbors with replace
authorWilliam A. Kennington III <william@wkennington.com>
Tue, 27 Apr 2021 08:25:58 +0000 (01:25 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 May 2021 18:09:31 +0000 (20:09 +0200)
commit941b1b86fe970b374a8a1cb2d161d4eb995ab14d
treee195d13484cc2a543126891282d9be9388282f15
parent89c5b12e82876b68252973210cb5ab98e5241ab1
network: neighbor: Always add neighbors with replace

We were duplicating setting flags for the message and a combination of
NLM_F_APPEND and NLM_F_CREATE which does not make sense. We should have
been using NLM_F_REPLACE and NLM_F_CREATE since the kernel can
dynamically create neighbors prior to us adding an entry. Otherwise, we
can end up with cases where the message will time out after ~25s even
though the neighbor still gets added. This delays the rest of the setup
of the interface even though the error is ultimately ignored.

(cherry picked from commit 192a9d95ea3e058afd824d38a9cea16ad0a84a57)
(cherry picked from commit cbbe6f78b7839bae605e0296f5d2ae2e3baa04a9)
src/libsystemd/sd-netlink/rtnl-message.c
src/network/networkd-neighbor.c