summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorpaul <paul>2002-12-13 20:52:52 +0000
committerpaul <paul>2002-12-13 20:52:52 +0000
commit48b33aaf706367aa9d647e2893f974a7f5740a6b (patch)
tree3c992dd22b17159d6f3abf657c58470b13820db9 /zebra/interface.c
parent727d104b15d6293d7223e7830f2e37ae98022cac (diff)
patch from Frank van Maarseveen <F.vanMaarseveen@inter.NL.net>
[zebra 14599] PATCH: permit [no]multicast command for (yet) inactive interfaces
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 5629ebb3..9846805b 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -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;