summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mroute.c
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2022-04-04 13:05:07 +0200
committerMobashshera Rasool <mrasool@vmware.com>2022-04-28 10:10:49 +0200
commit4d3b4b1851e4902512c53cd7cd8a78ccaa907573 (patch)
treed95a2817b5f409a1ea79a2eb96061a71a4514caf /zebra/zebra_mroute.c
parentMerge pull request #11031 from AbhishekNR/v6_multicast (diff)
downloadfrr-4d3b4b1851e4902512c53cd7cd8a78ccaa907573.tar.xz
frr-4d3b4b1851e4902512c53cd7cd8a78ccaa907573.zip
zebra: Modify base code to get ipv6 stats from kernel
Modify the structure mcast_route_data to store ipv4/ipv6 addr and lastused multicast information from kernel. Adjust the related APIs to parse ipv4/ipv6 informations. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'zebra/zebra_mroute.c')
-rw-r--r--zebra/zebra_mroute.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/zebra/zebra_mroute.c b/zebra/zebra_mroute.c
index ef0f2d892..d9a94bb0c 100644
--- a/zebra/zebra_mroute.c
+++ b/zebra/zebra_mroute.c
@@ -39,20 +39,14 @@ void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS)
int suc = -1;
memset(&mroute, 0, sizeof(mroute));
- STREAM_GET(&mroute.sg.src, msg, 4);
- STREAM_GET(&mroute.sg.grp, msg, 4);
+ STREAM_GET(&mroute.src.ipaddr_v4, msg, 4);
+ STREAM_GET(&mroute.grp.ipaddr_v4, msg, 4);
STREAM_GETL(msg, mroute.ifindex);
- if (IS_ZEBRA_DEBUG_KERNEL) {
- char sbuf[40];
- char gbuf[40];
-
- inet_ntop(AF_INET, &mroute.sg.src, sbuf, sizeof(sbuf));
- inet_ntop(AF_INET, &mroute.sg.grp, gbuf, sizeof(gbuf));
-
- zlog_debug("Asking for (%s,%s)[%s(%u)] mroute information",
- sbuf, gbuf, zvrf->vrf->name, zvrf->vrf->vrf_id);
- }
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug("Asking for (%pI4,%pI4)[%s(%u)] mroute information",
+ &mroute.src.ipaddr_v4, &mroute.grp.ipaddr_v4,
+ zvrf->vrf->name, zvrf->vrf->vrf_id);
suc = kernel_get_ipmr_sg_stats(zvrf, &mroute);
@@ -62,8 +56,8 @@ stream_failure:
stream_reset(s);
zclient_create_header(s, ZEBRA_IPMR_ROUTE_STATS, zvrf_id(zvrf));
- stream_put_in_addr(s, &mroute.sg.src);
- stream_put_in_addr(s, &mroute.sg.grp);
+ stream_put_in_addr(s, &mroute.src.ipaddr_v4);
+ stream_put_in_addr(s, &mroute.grp.ipaddr_v4);
stream_put(s, &mroute.lastused, sizeof(mroute.lastused));
stream_putl(s, (uint32_t)suc);