summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorpaul <paul>2003-08-01 00:24:13 +0000
committerpaul <paul>2003-08-01 00:24:13 +0000
commit106d2fd572c18bebe3dc44031c6d5e56e7b9030f (patch)
treedf226870be1178b347947aecbe7d468022b47a91 /ospfd
parent12ab19f1863e80134353244967a87805b12fe722 (diff)
2003-08-01 Cougar <cougar@random.ee>
* lib/if.c: (if_cmp_func) new function, compare interface names in alphabetical order. (if_create) Take name as argument and add interface in sorted order. (if_get_by_name),(interface_cmd) fixup calls to if_create - see above. (if_init) register list comparison function. * lib/if.h: Add comparison function, modify if_create prototype. * lib/zclient.c: Modify call to if_create. * ospfd/ospf_interface.c: (ospf_vl_new) modify call to if_create. change sprintf to snprintf. * zebra/kernel_socket.c: (ifm_read) modify call to if_create.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 8fa3fd63..067d551d 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -745,7 +745,8 @@ ospf_vl_new (struct ospf *ospf, struct ospf_vl_data *vl_data)
if (IS_DEBUG_OSPF_EVENT)
zlog_info ("ospf_vl_new(): creating pseudo zebra interface");
- vi = if_create ();
+ snprintf (ifname, INTERFACE_NAMSIZ + 1, "VLINK%d", vlink_count);
+ vi = if_create (ifname, INTERFACE_NAMSIZ);
co = connected_new ();
co->ifp = vi;
listnode_add (vi->connected, co);
@@ -769,10 +770,9 @@ ospf_vl_new (struct ospf *ospf, struct ospf_vl_data *vl_data)
voi->ifp->mtu = OSPF_VL_MTU;
voi->type = OSPF_IFTYPE_VIRTUALLINK;
- sprintf (ifname, "VLINK%d", vlink_count++);
+ vlink_count++;
if (IS_DEBUG_OSPF_EVENT)
zlog_info ("ospf_vl_new(): Created name: %s", ifname);
- strncpy (vi->name, ifname, IFNAMSIZ);
if (IS_DEBUG_OSPF_EVENT)
zlog_info ("ospf_vl_new(): set if->name to %s", vi->name);