Skip to content

Commit

Permalink
ip_tunnel: Do not use mark in skb by default
Browse files Browse the repository at this point in the history
This reverts commit 5c38bd1.

skb->mark contains the mark the encapsulated traffic which
can result in incorrect routing decisions being made such
as routing loops if the route chosen is via tunnel itself.
The correct method should be to use tunnel->fwmark.

Signed-off-by: Thomas Winter <thomas.winter@alliedtelesis.co.nz>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Winter authored and David S. Miller committed Feb 26, 2018
1 parent 0e5a82e commit 4e99477
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions net/ipv4/ip_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,16 +710,9 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
}
}

if (tunnel->fwmark) {
init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr,
tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
tunnel->fwmark);
}
else {
init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr,
tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
skb->mark);
}
init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr,
tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
tunnel->fwmark);

if (ip_tunnel_encap(skb, tunnel, &protocol, &fl4) < 0)
goto tx_error;
Expand Down

0 comments on commit 4e99477

Please sign in to comment.