From 215cb6354e6b4cae1c9b8262fd3ad04ac88ea21d Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Tue, 7 Jul 2015 17:43:26 +0300 Subject: fixed check for interface name length --- accel-pppd/ctrl/ipoe/ipoe.c | 2 +- accel-pppd/ifcfg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 1f904bf6..81c4df30 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2932,7 +2932,7 @@ static void add_vlan_mon(const char *opt, long *mask) for (ptr = opt; *ptr && *ptr != ','; ptr++); - if (ptr - opt >= sizeof(ifr.ifr_name)) { + if (ptr - opt >= IFNAMSIZ) { log_error("ipoe: vlan-mon=%s: interface name is too long\n", opt); return; } diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c index 5c828a78..77a37321 100644 --- a/accel-pppd/ifcfg.c +++ b/accel-pppd/ifcfg.c @@ -265,7 +265,7 @@ int __export ap_session_rename(struct ap_session *ses, const char *ifname, int l if (len == -1) len = strlen(ifname); - if (len >= IFNAMSIZ - 1) { + if (len >= IFNAMSIZ) { log_ppp_warn("cannot rename interface (name is too long)\n"); return -1; } -- cgit v1.2.3