]> 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)
commitcee990d66e63250baadae8a6dc4c821d6ab10c23
treea27e5012a75f82be3c1956720ffa0b0b61bf887b
parent097e5eb572144d4eae4ad7589b4162bb9dd1755e
ip6_tunnel: fix error code when tunnel exists

After commit 215c4610a8b1, 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: 215c4610a8b1 ("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