diff --git a/doc/user/pim.rst b/doc/user/pim.rst index 5a009eda6b..1c3a0110ac 100644 --- a/doc/user/pim.rst +++ b/doc/user/pim.rst @@ -176,7 +176,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 da5fdfa51e..9e6d16e10d 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -8237,7 +8237,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", @@ -8245,6 +8246,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);