]> git.puffer.fish Git - matthieu/frr.git/commitdiff
patch from Frank van Maarseveen <F.vanMaarseveen@inter.NL.net>
authorpaul <paul>
Fri, 13 Dec 2002 20:52:52 +0000 (20:52 +0000)
committerpaul <paul>
Fri, 13 Dec 2002 20:52:52 +0000 (20:52 +0000)
[zebra 14599] PATCH: permit [no]multicast command for (yet) inactive interfaces

zebra/interface.c

index 5629ebb3565e914a795f7f8fd4de31e234c135bf..9846805b947761a0a2df995a59cc67f68629dddb 100644 (file)
@@ -182,6 +182,14 @@ if_addr_wakeup (struct interface *ifp)
 void
 if_add_update (struct interface *ifp)
 {
+  struct zebra_if *if_data;
+
+  if_data = ifp->info;
+  if (if_data->multicast == IF_ZEBRA_MULTICAST_ON)
+    if_set_flags (ifp, IFF_MULTICAST);
+  else if (if_data->multicast == IF_ZEBRA_MULTICAST_OFF)
+    if_unset_flags (ifp, IFF_MULTICAST);
+
   zebra_interface_add_update (ifp);
 
   if (! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
@@ -739,16 +747,19 @@ DEFUN (multicast,
   struct zebra_if *if_data;
 
   ifp = (struct interface *) vty->index;
-  ret = if_set_flags (ifp, IFF_MULTICAST);
-  if (ret < 0)
+  if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
     {
-      vty_out (vty, "Can't set multicast flag%s", VTY_NEWLINE);
-      return CMD_WARNING;
+      ret = if_set_flags (ifp, IFF_MULTICAST);
+      if (ret < 0)
+       {
+         vty_out (vty, "Can't set multicast flag%s", VTY_NEWLINE);
+         return CMD_WARNING;
+       }
+      if_refresh (ifp);
     }
-  if_refresh (ifp);
   if_data = ifp->info;
   if_data->multicast = IF_ZEBRA_MULTICAST_ON;
-  
+
   return CMD_SUCCESS;
 }
 
@@ -763,13 +774,16 @@ DEFUN (no_multicast,
   struct zebra_if *if_data;
 
   ifp = (struct interface *) vty->index;
-  ret = if_unset_flags (ifp, IFF_MULTICAST);
-  if (ret < 0)
+  if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
     {
-      vty_out (vty, "Can't unset multicast flag%s", VTY_NEWLINE);
-      return CMD_WARNING;
+      ret = if_unset_flags (ifp, IFF_MULTICAST);
+      if (ret < 0)
+       {
+         vty_out (vty, "Can't unset multicast flag%s", VTY_NEWLINE);
+         return CMD_WARNING;
+       }
+      if_refresh (ifp);
     }
-  if_refresh (ifp);
   if_data = ifp->info;
   if_data->multicast = IF_ZEBRA_MULTICAST_OFF;