diff mbox

[net-next] bpf: fix bpf_skb_set_tunnel_key() helper

Message ID 1440629858-1847-1-git-send-email-ast@plumgrid.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Alexei Starovoitov Aug. 26, 2015, 10:57 p.m. UTC
Make sure to indicate to tunnel driver that key.tun_id is set,
otherwise gre won't recognize the metadata.

Fixes: d3aa45ce6b94 ("bpf: add helpers to access tunnel metadata")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---
With this fix both vxlan and gretap are working with tc+bpf.

 net/core/filter.c |    1 +
 1 file changed, 1 insertion(+)

Comments

David Miller Aug. 27, 2015, 12:38 a.m. UTC | #1
From: Alexei Starovoitov <ast@plumgrid.com>
Date: Wed, 26 Aug 2015 15:57:38 -0700

> Make sure to indicate to tunnel driver that key.tun_id is set,
> otherwise gre won't recognize the metadata.
> 
> Fixes: d3aa45ce6b94 ("bpf: add helpers to access tunnel metadata")
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
> ---
> With this fix both vxlan and gretap are working with tc+bpf.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/filter.c b/net/core/filter.c
index b4adc961413f..66500d490995 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1528,6 +1528,7 @@  static u64 bpf_skb_set_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5)
 
 	info = &md->u.tun_info;
 	info->mode = IP_TUNNEL_INFO_TX;
+	info->key.tun_flags = TUNNEL_KEY;
 	info->key.tun_id = cpu_to_be64(from->tunnel_id);
 	info->key.u.ipv4.dst = cpu_to_be32(from->remote_ipv4);