summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_tunnel.c
diff options
context:
space:
mode:
authorDuan Jiong <duanj.fnst@cn.fujitsu.com>2014-05-15 07:07:02 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-16 22:57:44 +0200
commitee30ef4d45e7bb64a13e6f3c35b4c75b12a8a4e9 (patch)
tree810cc07129201a9bd578fbc6fe95a28f2c094d6b /net/ipv4/ip_tunnel.c
parenttools: bpf_jit_disasm: increase image buffer size (diff)
downloadlinux-ee30ef4d45e7bb64a13e6f3c35b4c75b12a8a4e9.tar.xz
linux-ee30ef4d45e7bb64a13e6f3c35b4c75b12a8a4e9.zip
ip_tunnel: don't add tunnel twice
When using command "ip tunnel add" to add a tunnel, the tunnel will be added twice, through ip_tunnel_create() and ip_tunnel_update(). Because the second is unnecessary, so we can just break after adding tunnel through ip_tunnel_create(). Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_tunnel.c')
-rw-r--r--net/ipv4/ip_tunnel.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 059176dfab7f..289c6ee388c1 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -754,10 +754,8 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd)
if (!t && (cmd == SIOCADDTUNNEL)) {
t = ip_tunnel_create(net, itn, p);
- if (IS_ERR(t)) {
- err = PTR_ERR(t);
- break;
- }
+ err = PTR_ERR_OR_ZERO(t);
+ break;
}
if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
if (t != NULL) {