diff mbox series

iptunnel: Set tun_flags in the iptunnel_metadata_reply from src

Message ID 1545553119-29549-1-git-send-email-wenxu@ucloud.cn
State Accepted, archived
Delegated to: David Miller
Headers show
Series iptunnel: Set tun_flags in the iptunnel_metadata_reply from src | expand

Commit Message

wenxu Dec. 23, 2018, 8:18 a.m. UTC
From: wenxu <wenxu@ucloud.cn>

ip l add tun type gretap external
ip r a 10.0.0.2 encap ip id 1000 dst 172.168.0.2 key dev tun
ip a a 10.0.0.1/24 dev tun

The peer arp request to 10.0.0.1 with tunnel_id, but the arp reply
only set the tun_id but not the tun_flags with TUNNEL_KEY. The arp
reply packet don't contain tun_id field.

Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/ipv4/ip_tunnel_core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller Dec. 24, 2018, 10:20 p.m. UTC | #1
From: wenxu@ucloud.cn
Date: Sun, 23 Dec 2018 16:18:39 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> ip l add tun type gretap external
> ip r a 10.0.0.2 encap ip id 1000 dst 172.168.0.2 key dev tun
> ip a a 10.0.0.1/24 dev tun
> 
> The peer arp request to 10.0.0.1 with tunnel_id, but the arp reply
> only set the tun_id but not the tun_flags with TUNNEL_KEY. The arp
> reply packet don't contain tun_id field.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.
diff mbox series

Patch

diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index c857ec6..9a0e67b 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -151,6 +151,7 @@  struct metadata_dst *iptunnel_metadata_reply(struct metadata_dst *md,
 		       sizeof(struct in6_addr));
 	else
 		dst->key.u.ipv4.dst = src->key.u.ipv4.src;
+	dst->key.tun_flags = src->key.tun_flags;
 	dst->mode = src->mode | IP_TUNNEL_INFO_TX;
 
 	return res;