]> git.proxmox.com Git - mirror_frr.git/commitdiff
eigrpd: Test for EIGRP AS number and ensure it's the same
authorDon Slice <dslice@nvidia.com>
Mon, 3 May 2021 11:57:29 +0000 (07:57 -0400)
committerDon Slice <dslice@nvidia.com>
Mon, 3 May 2021 18:26:27 +0000 (14:26 -0400)
When receiving a packet, ensure that the AS number is the same.

Fixes: 8515
Signed-off-by: Don Slice <dslice@nvidia.com>
eigrpd/eigrp_packet.c

index 0b37733990ebaa401a94764f4098e08d4c493cdf..39e384c121f56c82fc0cfdb25d23fb4a669ac4e3 100644 (file)
@@ -572,9 +572,14 @@ int eigrp_read(struct thread *thread)
            && IS_DEBUG_EIGRP_TRANSMIT(0, PACKET_DETAIL))
                eigrp_header_dump(eigrph);
 
-       //  if (MSG_OK != eigrp_packet_examin(eigrph, stream_get_endp(ibuf) -
-       //  stream_get_getp(ibuf)))
-       //    return -1;
+       if (ntohs(eigrph->ASNumber) != eigrp->AS) {
+               if (IS_DEBUG_EIGRP_TRANSMIT(0, RECV))
+                       zlog_debug(
+                               "ignoring packet from router %u sent to %pI4, wrong AS Number received: %u",
+                               ntohs(eigrph->vrid), &iph->ip_dst,
+                               ntohs(eigrph->ASNumber));
+               return 0;
+       }
 
        /* If incoming interface is passive one, ignore it. */
        if (eigrp_if_is_passive(ei)) {