All of lore.kernel.org
 help / color / mirror / Atom feed
From: wenxu@ucloud.cn
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 3/4] ip_tunnel: Fix route fl4 init in ip_md_tunnel_xmit
Date: Tue, 22 Jan 2019 17:39:23 +0800	[thread overview]
Message-ID: <1548149964-21299-4-git-send-email-wenxu@ucloud.cn> (raw)
In-Reply-To: <1548149964-21299-1-git-send-email-wenxu@ucloud.cn>

From: wenxu <wenxu@ucloud.cn>

Init the gre_key from tuninfo->key.tun_id and init the mark
from the skb->mark, set the oif zero in the collect metadata mode

Fixes: cfc7381 ("ip_tunnel: add collect_md mode to IPIP tunnel'")

Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/ipv4/ip_tunnel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 6233a7c..3a15ee1 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,
 		else if (skb->protocol == htons(ETH_P_IPV6))
 			tos = ipv6_get_dsfield((const struct ipv6hdr *)inner_iph);
 	}
-	ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, 0,
-			    RT_TOS(tos), tunnel->parms.link, tunnel->fwmark);
+	ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src,
+			    tunnel_id_to_key32(key->tun_id), RT_TOS(tos),
+			    0, skb->mark);
 	if (tunnel->encap.type != TUNNEL_ENCAP_NONE)
 		goto tx_error;
 
-- 
1.8.3.1


  parent reply	other threads:[~2019-01-22  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22  9:39 [PATCH net-next 0/4] ip_tunnel: Refactor ip_gre collect metadata xmit to ip_md_tunnel_xmit wenxu
2019-01-22  9:39 ` [PATCH net-next 1/4] ip_tunnel: Add ip tunnel dst_cache in ip_md_tunnel_xmit wenxu
2019-01-22  9:39 ` [PATCH net-next 2/4] ip_tunnel: Add tnl_update_pmtu " wenxu
2019-01-22  9:39 ` wenxu [this message]
2019-01-22 10:05   ` [PATCH net-next 3/4] ip_tunnel: Fix route fl4 init " Sergei Shtylyov
2019-01-22  9:39 ` [PATCH net-next 4/4] ip_gre: Refactor collect metatdata mode tunnel xmit to ip_md_tunnel_xmit wenxu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1548149964-21299-4-git-send-email-wenxu@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.