summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-neighbor.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-07-10 04:55:25 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-07-30 17:00:07 +0200
commitbbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839 (patch)
treef099ddec95a949ce2ce2c55884a51def82f78b67 /src/network/networkd-neighbor.c
parentnetwork: ndisc - Honour CurHopLimit (diff)
downloadsystemd-bbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839.tar.xz
systemd-bbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839.zip
network/neighbor: skip to request neighbors with unmatching link layer address length
Diffstat (limited to 'src/network/networkd-neighbor.c')
-rw-r--r--src/network/networkd-neighbor.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c
index c1629ae3e9..aa752caff3 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;