summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_packet.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2025-03-24 08:07:02 -0400
committerDonald Sharp <sharpd@nvidia.com>2025-03-24 11:36:13 -0400
commitefb2aeae7b0d565f919bcd77345b78a9bd91e297 (patch)
tree2936d4d76bd210d0ac2de7dcc3c3c4397bf6f0bc /eigrpd/eigrp_packet.c
parent95e7f56eec5797a9e6d46d91441d611592b952cf (diff)
eigrpd: Cleanup memory issues on shutdown
a) EIGRP was having issues with the prefix created as part of the topology destination. Make this just a part of the topology data structure instead of allocating it. b) EIGRP was not freeing up any memory associated with the network table. Free it. c) EIGRP was confusing zebra shutdown as part of the deletion of the last eigrp data structure. This was inappropriate it should be part of the `I'm just shutting down`. d) The QOBJ was not being properly freed, free it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'eigrpd/eigrp_packet.c')
-rw-r--r--eigrpd/eigrp_packet.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
index 189d9330cf..7560514cec 100644
--- a/eigrpd/eigrp_packet.c
+++ b/eigrpd/eigrp_packet.c
@@ -1129,7 +1129,7 @@ uint16_t eigrp_add_internalTLV_to_stream(struct stream *s,
uint16_t length;
stream_putw(s, EIGRP_TLV_IPv4_INT);
- switch (pe->destination->prefixlen) {
+ switch (pe->destination.prefixlen) {
case 0:
case 1:
case 2:
@@ -1176,8 +1176,8 @@ uint16_t eigrp_add_internalTLV_to_stream(struct stream *s,
stream_putw(s, length);
break;
default:
- flog_err(EC_LIB_DEVELOPMENT, "%s: Unexpected prefix length: %d",
- __func__, pe->destination->prefixlen);
+ flog_err(EC_LIB_DEVELOPMENT, "%s: Unexpected prefix length: %d", __func__,
+ pe->destination.prefixlen);
return 0;
}
stream_putl(s, 0x00000000);
@@ -1194,15 +1194,15 @@ uint16_t eigrp_add_internalTLV_to_stream(struct stream *s,
stream_putc(s, pe->reported_metric.tag);
stream_putc(s, pe->reported_metric.flags);
- stream_putc(s, pe->destination->prefixlen);
+ stream_putc(s, pe->destination.prefixlen);
- stream_putc(s, (ntohl(pe->destination->u.prefix4.s_addr) >> 24) & 0xFF);
- if (pe->destination->prefixlen > 8)
- stream_putc(s, (ntohl(pe->destination->u.prefix4.s_addr) >> 16) & 0xFF);
- if (pe->destination->prefixlen > 16)
- stream_putc(s, (ntohl(pe->destination->u.prefix4.s_addr) >> 8) & 0xFF);
- if (pe->destination->prefixlen > 24)
- stream_putc(s, ntohl(pe->destination->u.prefix4.s_addr) & 0xFF);
+ stream_putc(s, (ntohl(pe->destination.u.prefix4.s_addr) >> 24) & 0xFF);
+ if (pe->destination.prefixlen > 8)
+ stream_putc(s, (ntohl(pe->destination.u.prefix4.s_addr) >> 16) & 0xFF);
+ if (pe->destination.prefixlen > 16)
+ stream_putc(s, (ntohl(pe->destination.u.prefix4.s_addr) >> 8) & 0xFF);
+ if (pe->destination.prefixlen > 24)
+ stream_putc(s, ntohl(pe->destination.u.prefix4.s_addr) & 0xFF);
return length;
}