]> git.baikalelectronics.ru Git - kernel.git/commit
ip6_tunnel: fix error code when tunnel exists
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Mon, 16 Mar 2015 14:56:05 +0000 (15:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Mar 2015 19:01:18 +0000 (15:01 -0400)
commita1eaa29fe86ed22eb9e25b16610f3c95e2961669
treea27e5012a75f82be3c1956720ffa0b0b61bf887b
parent8c97ab658036a1ce54d38bb836235d164bc65983
ip6_tunnel: fix error code when tunnel exists

After commit 18489a719232, the kernel returns -ENOBUFS when user tries to add
an existing tunnel with ioctl API:
$ ip -6 tunnel add ip6tnl1 mode ip6ip6 dev eth1
add tunnel "ip6tnl0" failed: No buffer space available

It's confusing, the right error is EEXIST.

This patch also change a bit the code returned:
 - ENOBUFS -> ENOMEM
 - ENOENT -> ENODEV

Fixes: 18489a719232 ("ip6_tunnel: Return an error when adding an existing tunnel.")
CC: Steffen Klassert <steffen.klassert@secunet.com>
Reported-by: Pierre Cheynier <me@pierre-cheynier.net>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_tunnel.c