2004-12-15 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_interface.h: Declare new function ospf_default_iftype.
* ospf_interface.c: (ospf_default_iftype) New function to centralize
this logic in one place.
* ospf_zebra.c: (ospf_interface_add) Use new function
ospf_default_iftype.
* ospf_vty.c: (no_ip_ospf_network,config_write_interface) Fix logic
by using new function ospf_default_iftype.
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 6a679f9..b9c554f 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -4853,7 +4853,7 @@
int old_type = IF_DEF_PARAMS (ifp)->type;
struct route_node *rn;
- IF_DEF_PARAMS (ifp)->type = OSPF_IFTYPE_BROADCAST;
+ IF_DEF_PARAMS (ifp)->type = ospf_default_iftype(ifp);
if (IF_DEF_PARAMS (ifp)->type == old_type)
return CMD_SUCCESS;
@@ -6722,8 +6722,7 @@
if (OSPF_IF_PARAM_CONFIGURED (params, type) &&
params->type != OSPF_IFTYPE_LOOPBACK)
{
- if ((!if_is_broadcast(ifp)) &&
- (params->type != OSPF_IFTYPE_BROADCAST))
+ if (params->type != ospf_default_iftype(ifp))
{
vty_out (vty, " ip ospf network %s",
ospf_int_type_str[params->type]);