From a349198fd3e4e5692cdc91223f8153cb53c086ce Mon Sep 17 00:00:00 2001 From: ajs Date: Sat, 2 Apr 2005 22:50:38 +0000 Subject: 2005-04-02 Andrew J. Schorr * if.h: (if_lookup_by_name_len, if_get_by_name_len) New functions. * if.c: (if_lookup_by_name_len, if_get_by_name_len) New functions. (if_get_by_name) Tighten up code. (interface) Use new function if_get_by_name_len. * zclient.c: (zebra_interface_add_read) Use new if_get_by_name_len function. (zebra_interface_state_read) Use new if_lookup_by_name_len function. * kernel_socket.c: (ifm_read) Use new if_lookup_by_name_len function to save a memcpy. * if_ioctl_solaris.c: (interface_list_ioctl) Fix subtle bug with new if_get_by_name_len function. * ospf_interface.c: (ospf_vl_new) Use strnlen to fix call to if_create. --- ospfd/ChangeLog | 4 ++++ ospfd/ospf_interface.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ospfd') diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index b1d6bbec..e8eae90e 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,7 @@ +2005-04-02 Andrew J. Schorr + + * ospf_interface.c: (ospf_vl_new) Use strnlen to fix call to if_create. + 2005-04-02 Andrew J. Schorr * ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index b76abe58..027dfb9d 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -880,8 +880,8 @@ ospf_vl_new (struct ospf *ospf, struct ospf_vl_data *vl_data) if (IS_DEBUG_OSPF_EVENT) zlog_debug ("ospf_vl_new(): creating pseudo zebra interface"); - snprintf (ifname, INTERFACE_NAMSIZ + 1, "VLINK%d", vlink_count); - vi = if_create (ifname, INTERFACE_NAMSIZ); + snprintf (ifname, sizeof(ifname), "VLINK%d", vlink_count); + vi = if_create (ifname, strnlen(ifname, sizeof(ifname))); co = connected_new (); co->ifp = vi; listnode_add (vi->connected, co); -- cgit v1.2.1