From: Yu Watanabe Date: Mon, 10 Jul 2023 02:55:25 +0000 (+0900) Subject: network/neighbor: skip to request neighbors with unmatching link layer address length X-Git-Tag: v255-rc1~882^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839;p=thirdparty%2Fsystemd.git network/neighbor: skip to request neighbors with unmatching link layer address length --- diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index c1629ae3e9a..aa752caff3b 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -256,6 +256,16 @@ static int link_request_neighbor(Link *link, const Neighbor *neighbor) { assert(neighbor); assert(neighbor->source != NETWORK_CONFIG_SOURCE_FOREIGN); + if (neighbor->ll_addr.length != link->hw_addr.length) { + log_link_debug(link, + "The link layer address lenght (%zu) for neighbor %s does not match with " + "the hardware address length (%zu), ignoring the setting.", + neighbor->ll_addr.length, + IN_ADDR_TO_STRING(neighbor->family, &neighbor->in_addr), + link->hw_addr.length); + return 0; + } + if (neighbor_get(link, neighbor, &existing) < 0) { _cleanup_(neighbor_freep) Neighbor *tmp = NULL;