From c770517e4b40dc91534df5ac28af1b40939476a2 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Fri, 21 May 2021 11:02:25 +0200 Subject: [PATCH] Remove confusing error message --- ethsock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethsock.c b/ethsock.c index 95a4526..4950cb3 100644 --- a/ethsock.c +++ b/ethsock.c @@ -312,8 +312,8 @@ static bool intf_add_del_arp(const char *intf, uint32_t ipaddr, uint8_t *hwaddr, err = rtnl_neigh_add(sk, neigh, NLM_F_CREATE); } - if (err && (add || verbosity > 1)) { - nl_perror(err, add ? "rtnl_neigh_add" : "rtnl_neigh_delete"); + if (err && add) { + nl_perror(err, "rtnl_neigh_add"); } out: @@ -837,7 +837,9 @@ static int ethsock_arp(struct ethsock *sock, uint8_t *hwaddr, uint32_t ipaddr, s int ethsock_arp_add(struct ethsock *sock, uint8_t *hwaddr, uint32_t ipaddr, struct ethsock_arp_undo **undo) { + // remove any previous ARP entry ethsock_arp(sock, hwaddr, ipaddr, NULL); + // add the new ARP entry return undo ? ethsock_arp(sock, hwaddr, ipaddr, undo) : -1; }