diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-02 22:05:57 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 09:01:24 -0300 |
| commit | bcc245799be7e90d912bd8d2774465fd9d407707 (patch) | |
| tree | 3a8ec12a5c12e310b8a799908816db231c340785 /zebra/kernel_socket.c | |
| parent | e56ab0e97122d35d3f8d21faf820a90eb1953948 (diff) | |
lib: nuke the if_*_by_name_len() functions
Make use of strnlen() and strlcpy() so we can get rid of these
convoluted if_*_by_name_len() functions.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/kernel_socket.c')
| -rw-r--r-- | zebra/kernel_socket.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 9907ef5b79..cbfc371199 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -323,10 +323,7 @@ static int ifan_read(struct if_announcemsghdr *ifan) __func__, ifan->ifan_index, ifan->ifan_name); /* Create Interface */ - ifp = if_get_by_name_len( - ifan->ifan_name, - strnlen(ifan->ifan_name, sizeof(ifan->ifan_name)), - VRF_DEFAULT, 0); + ifp = if_get_by_name(ifan->ifan_name, VRF_DEFAULT, 0); ifp->ifindex = ifan->ifan_index; if_get_metric(ifp); @@ -517,7 +514,7 @@ int ifm_read(struct if_msghdr *ifm) if (ifp == NULL) { /* Interface that zebra was not previously aware of, so * create. */ - ifp = if_create(ifname, ifnlen, VRF_DEFAULT); + ifp = if_create(ifname, VRF_DEFAULT); if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("%s: creating ifp for ifindex %d", __func__, ifm->ifm_index); |
