提交 54a5d382 编写于 作者: P Pravin B Shelar 提交者: David S. Miller

ip_tunnel: Fix off-by-one error in forming dev name.

As Ben pointed out following patch fixes bug in checking device
name length limits while forming tunnel device name.

CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 27815032
......@@ -284,7 +284,7 @@ static struct net_device *__ip_tunnel_create(struct net *net,
if (parms->name[0])
strlcpy(name, parms->name, IFNAMSIZ);
else {
if (strlen(ops->kind) + 3 >= IFNAMSIZ) {
if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
err = -E2BIG;
goto failed;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册