diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-07-10 04:55:25 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-07-30 17:00:07 +0200 |
commit | bbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839 (patch) | |
tree | f099ddec95a949ce2ce2c55884a51def82f78b67 /src/network/networkd-neighbor.c | |
parent | network: ndisc - Honour CurHopLimit (diff) | |
download | systemd-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.c | 10 |
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; |