diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-11-21 08:08:29 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-21 08:08:29 -0500 |
| commit | 07b91ca0967fb898e4060367d485b85f965856e2 (patch) | |
| tree | a19cca0d1c7d874a89735783660f495a56596f7b /lib/if.c | |
| parent | 77ff93b8f5f714880dfe56ff01a57870fd2ed8b6 (diff) | |
*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ
INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ
is the standard for interface name length on all platforms
that FRR currently compiles on.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -362,8 +362,7 @@ struct interface *if_lookup_by_name(const char *name, vrf_id_t vrf_id) struct vrf *vrf = vrf_lookup_by_id(vrf_id); struct interface if_tmp; - if (!vrf || !name - || strnlen(name, INTERFACE_NAMSIZ) == INTERFACE_NAMSIZ) + if (!vrf || !name || strnlen(name, IFNAMSIZ) == IFNAMSIZ) return NULL; strlcpy(if_tmp.name, name, sizeof(if_tmp.name)); @@ -374,7 +373,7 @@ struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf) { struct interface if_tmp; - if (!name || strnlen(name, INTERFACE_NAMSIZ) == INTERFACE_NAMSIZ) + if (!name || strnlen(name, IFNAMSIZ) == IFNAMSIZ) return NULL; strlcpy(if_tmp.name, name, sizeof(if_tmp.name)); @@ -386,7 +385,7 @@ static struct interface *if_lookup_by_name_all_vrf(const char *name) struct vrf *vrf; struct interface *ifp; - if (!name || strnlen(name, INTERFACE_NAMSIZ) == INTERFACE_NAMSIZ) + if (!name || strnlen(name, IFNAMSIZ) == IFNAMSIZ) return NULL; RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { |
