Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee30ef4d authored by Duan Jiong's avatar Duan Jiong Committed by David S. Miller
Browse files

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: default avatarDuan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9bb1a208
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -754,11 +754,9 @@ 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);
			err = PTR_ERR_OR_ZERO(t);
			break;
		}
		}
		if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
			if (t != NULL) {
				if (t->dev != dev) {