diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-07-07 17:43:26 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-07-07 17:43:26 +0300 |
commit | 215cb6354e6b4cae1c9b8262fd3ad04ac88ea21d (patch) | |
tree | ecab8801cafdcc96bc84a334f89cf22e260cdb0b | |
parent | d5b314539669e2d13af8bc638dfbaa0516ca10ea (diff) | |
download | accel-ppp-215cb6354e6b4cae1c9b8262fd3ad04ac88ea21d.tar.gz accel-ppp-215cb6354e6b4cae1c9b8262fd3ad04ac88ea21d.zip |
fixed check for interface name length
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 2 | ||||
-rw-r--r-- | accel-pppd/ifcfg.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 1f904bf..81c4df3 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 5c828a7..77a3732 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; } |