From 9f92e2352be4fd85a59f9ee541718ae76c719968 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Mon, 3 May 2021 07:57:29 -0400 Subject: [PATCH] eigrpd: Test for EIGRP AS number and ensure it's the same When receiving a packet, ensure that the AS number is the same. Fixes: 8515 Signed-off-by: Don Slice --- eigrpd/eigrp_packet.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c index 0b37733990..39e384c121 100644 --- a/eigrpd/eigrp_packet.c +++ b/eigrpd/eigrp_packet.c @@ -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)) {