Browse Source

vtysh: Make ipv6 unicast/multicast address-family work

In the absence of this patch, attempting to type "address-family ipv6 unicast"
would result in an "Ambiguous command" error and in the case of
"address-family ipv6 multicast", the command would silently fail, without the
prompt dropping into the address-family mode.

The cause is how the parse tree is constructed for ipv6 address family. There
was an error in script and in vtysh.c files which assumed that
there was only address family ipv6 command, without unicast or multicast and
so the command was failing.

Signed-off-by: vivek <>
vivek 4 years ago
2 changed files with 2 additions and 1 deletions
  1. 1 1
  2. 1 0

+ 1 - 1

@@ -46,7 +46,7 @@ $ignore{'"router zebra"'} = "ignore";
 $ignore{'"address-family ipv4"'} = "ignore";
 $ignore{'"address-family ipv4 (unicast|multicast)"'} = "ignore";
 $ignore{'"address-family ipv6"'} = "ignore";
-$ignore{'"address-family ipv6 unicast"'} = "ignore";
+$ignore{'"address-family ipv6 (unicast|multicast)"'} = "ignore";
 $ignore{'"address-family vpnv4"'} = "ignore";
 $ignore{'"address-family vpnv4 unicast"'} = "ignore";
 $ignore{'"address-family ipv4 vrf NAME"'} = "ignore";

+ 1 - 0

@@ -2564,6 +2564,7 @@ vtysh_init_vty (void)
 #ifdef HAVE_IPV6
   install_element (BGP_NODE, &address_family_ipv6_cmd);
   install_element (BGP_NODE, &address_family_ipv6_unicast_cmd);
+  install_element (BGP_NODE, &address_family_ipv6_multicast_cmd);
   install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
   install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);