]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/neighbor: skip to request neighbors with unmatching link layer address length
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Jul 2023 02:55:25 +0000 (11:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 30 Jul 2023 15:00:07 +0000 (00:00 +0900)
src/network/networkd-neighbor.c

index c1629ae3e9aabbc9f4217a40591c89bf23d79792..aa752caff3b4b4ec668bf6e271f41a8305883284 100644 (file)
@@ -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;