aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2013-03-28 04:21:46 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-29 15:24:28 -0400
commit54a5d3828995c0df4f8e12a5d91b1c42f0f323d6 (patch)
tree40d57f9ab4a605ef62ff6382cf35a3315cf67599 /net/ipv4
parent278150321a3f5af85803e1214807ca5cfbace0e1 (diff)
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: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_tunnel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 9d96b6853f21..e4147ec1665a 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -284,7 +284,7 @@ static struct net_device *__ip_tunnel_create(struct net *net,
284 if (parms->name[0]) 284 if (parms->name[0])
285 strlcpy(name, parms->name, IFNAMSIZ); 285 strlcpy(name, parms->name, IFNAMSIZ);
286 else { 286 else {
287 if (strlen(ops->kind) + 3 >= IFNAMSIZ) { 287 if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
288 err = -E2BIG; 288 err = -E2BIG;
289 goto failed; 289 goto failed;
290 } 290 }