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

Commit 8db99e57 authored by Sascha Hlusiak's avatar Sascha Hlusiak Committed by David S. Miller
Browse files

sit: Fail to create tunnel, if it already exists



When locating the tunnel, do not continue if it is found. Otherwise
a different tunnel with similar configuration would be returned and
parts could be overwritten.

Signed-off-by: default avatarSascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9643f455
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -165,9 +165,14 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
	struct sit_net *sitn = net_generic(net, sit_net_id);

	for (tp = __ipip6_bucket(sitn, parms); (t = *tp) != NULL; tp = &t->next) {
		if (local == t->parms.iph.saddr && remote == t->parms.iph.daddr)
		if (local == t->parms.iph.saddr &&
		    remote == t->parms.iph.daddr) {
			if (create)
				return NULL;
			else
				return t;
		}
	}
	if (!create)
		goto failed;