summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorDon Slice <dslice@nvidia.com>2021-05-03 13:57:29 +0200
committerDon Slice <dslice@nvidia.com>2021-05-03 20:26:27 +0200
commit9f92e2352be4fd85a59f9ee541718ae76c719968 (patch)
treea71754b349b66b2681716eacf133420ad478729a /eigrpd
parentMerge pull request #8545 from opensourcerouting/assert-our-own (diff)
downloadfrr-9f92e2352be4fd85a59f9ee541718ae76c719968.tar.xz
frr-9f92e2352be4fd85a59f9ee541718ae76c719968.zip
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 <dslice@nvidia.com>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_packet.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
index 0b3773399..39e384c12 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)) {