From 9d13c2b5e55916c0ec69d3435fcb63f01fb70bab Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Sun, 10 Dec 2017 15:41:58 +0100 Subject: [PATCH] Remove unneeded length check for interface name. Since the length is checked in all other relevant places, the check here is not needed, and was too strict for the "vde" case. --- src/dpni20.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dpni20.c b/src/dpni20.c index 57c1d5f..358c52c 100644 --- a/src/dpni20.c +++ b/src/dpni20.c @@ -465,12 +465,12 @@ void net_init(struct dpni20_s *dpni) /* Get the IP address for the tunnel, if specified */ memcpy((char *)&tun_ip, (char *)&dpni->dpni_tun, 4); - /* Ensure network device name, if specified, isn't too long */ - if (dpni->dpni_ifnam[0] && (strlen(dpni->dpni_ifnam) - >= sizeof(ifr.ifr_name))) { - esfatal(0, "interface name \"%s\" too long - max %d", - dpni->dpni_ifnam, (int)sizeof(ifr.ifr_name)); - } + /* We should ensure that network device name, if specified, isn't too long. + ** For some usages however, this isn't really a device name, + ** so we can't really check it here. + ** In the paths where a shorter limit holds, there should be a specific + ** extra check for sizeof(ifr.ifr_name), IFNAMSIZ, or equivalent. + **/ /* Determine network device to use, if none was specified (this only ** works for shared devices, as dedicated ones will be "down" and