summaryrefslogtreecommitdiffstats
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorajs <ajs>2005-04-03 05:40:52 +0200
committerajs <ajs>2005-04-03 05:40:52 +0200
commit08dbfb691d8e03c7200138d55447fc29916e0362 (patch)
tree54d8718c7bdb035197cebcedef7d3de4f0038d55 /zebra/kernel_socket.c
parent2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff)
downloadfrr-08dbfb691d8e03c7200138d55447fc29916e0362.tar.xz
frr-08dbfb691d8e03c7200138d55447fc29916e0362.zip
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if_ioctl.c: (interface_list_ioctl) Use if_get_by_name_len. * if_proc.c: (ifaddr_proc_ipv6) Increase size of ifname buffer to avoid overflow. * kernel_socket.c: (ifan_read) Use if_get_by_name_len. * if.h: Fix comments to reflect that if_lookup_by_name and if_get_by_name now require the argument strings to be NUL-terminated. * if.c: (if_lookup_by_name) Compare using strcmp. (if_get_by_name) Pass strlen(ifname) as 2nd arg to if_create.
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 121256302..c1f785d46 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -201,7 +201,9 @@ ifan_read (struct if_announcemsghdr *ifan)
if (ifp == NULL && ifan->ifan_what == IFAN_ARRIVAL)
{
/* Create Interface */
- ifp = if_get_by_name (ifan->ifan_name);
+ ifp = if_get_by_name_len(ifan->ifan_name,
+ strnlen(ifan->ifan_name,
+ sizeof(ifan->ifan_name)));
ifp->ifindex = ifan->ifan_index;
if_add_update (ifp);