From 761e4fbad8826ba79134300ac8784bb80e6c4d55 Mon Sep 17 00:00:00 2001 From: nsaigomathi Date: Thu, 29 Jul 2021 02:22:42 -0700 Subject: [PATCH] pimd: IGMP Query Generation Problem: ======= Generate query once cli is generating IGMPv2 report for IGMPv3 enabled interface Description: =========== If the version is not specified in the cli, it was taking version 2 as default Fix: === If the version is not specified in the cli along with ip igmp generate-query-once, the default will be the version enabled on that interface. Signed-off-by: nsaigomathi --- doc/user/pim.rst | 2 +- pimd/pim_cmd.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/user/pim.rst b/doc/user/pim.rst index 899a6b0078..3bbb3b682f 100644 --- a/doc/user/pim.rst +++ b/doc/user/pim.rst @@ -160,7 +160,7 @@ Certain signals have special meanings to *pimd*. Generate IGMP query (v2/v3) on user requirement. This will not depend on the existing IGMP general query timer.If no version is provided in the cli, - it will be considered as default v2 query.This is a hidden command. + the default will be the igmp version enabled on that interface. .. clicmd:: ip igmp watermark-warn (1-65535) diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 81b3ab2979..ca2a49e342 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -8184,7 +8184,8 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate, "IGMP version number\n") { VTY_DECLVAR_CONTEXT(interface, ifp); - int igmp_version = 2; + int igmp_version; + struct pim_interface *pim_ifp = ifp->info; if (!ifp->info) { vty_out(vty, "IGMP/PIM is not enabled on the interface %s\n", @@ -8192,6 +8193,9 @@ DEFPY_HIDDEN (interface_ip_igmp_query_generate, return CMD_WARNING_CONFIG_FAILED; } + /* It takes the igmp version configured on the interface as default */ + igmp_version = pim_ifp->version; + if (argc > 3) igmp_version = atoi(argv[4]->arg);