提交 215cb635 编写于 作者: D Dmitry Kozlov

fixed check for interface name length

上级 d5b31453
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册