diff options
author | wenxu <wenxu@ucloud.cn> | 2019-01-22 05:39:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-26 12:43:03 -0500 |
commit | 6e6b904ad4f9aed43ec320afbd5a52ed8461ab41 (patch) | |
tree | 60620177f2f84d22cde04109fc48b6e8d6c12425 | |
parent | c8b34e680a090ab8dc42f8331020e31052b49a70 (diff) |
ip_tunnel: Fix route fl4 init in ip_md_tunnel_xmit
Init the gre_key from tuninfo->key.tun_id and init the mark
from the skb->mark, set the oif to zero in the collect metadata
mode.
Fixes: cfc7381b3002 ("ip_tunnel: add collect_md mode to IPIP tunnel")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/ip_tunnel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 6233a7c434b1..3a15ee1a775e 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -582,8 +582,9 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
582 | else if (skb->protocol == htons(ETH_P_IPV6)) | 582 | else if (skb->protocol == htons(ETH_P_IPV6)) |
583 | tos = ipv6_get_dsfield((const struct ipv6hdr *)inner_iph); | 583 | tos = ipv6_get_dsfield((const struct ipv6hdr *)inner_iph); |
584 | } | 584 | } |
585 | ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, 0, | 585 | ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, |
586 | RT_TOS(tos), tunnel->parms.link, tunnel->fwmark); | 586 | tunnel_id_to_key32(key->tun_id), RT_TOS(tos), |
587 | 0, skb->mark); | ||
587 | if (tunnel->encap.type != TUNNEL_ENCAP_NONE) | 588 | if (tunnel->encap.type != TUNNEL_ENCAP_NONE) |
588 | goto tx_error; | 589 | goto tx_error; |
589 | 590 | ||