Blob Blame History Raw
From: Xin Long <lucien.xin@gmail.com>
Date: Fri, 13 Dec 2019 16:53:07 +0800
Subject: netfilter: nft_tunnel: also dump ERSPAN_VERSION
Patch-mainline: v5.6-rc1
Git-commit: 2149f36dbd44f2d6bf5357e5d096205b92cd854a
References: bsc#1176447

This is not necessary, but it'll be easier to parse in userspace,
also given that other places like act_tunnel_key, cls_flower and
ip_tunnel_core are also doing so.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 net/netfilter/nft_tunnel.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -482,6 +482,9 @@ static int nft_tunnel_opts_dump(struct s
 				 htonl(opts->u.vxlan.gbp)))
 			return -1;
 	} else if (opts->flags & TUNNEL_ERSPAN_OPT) {
+		if (nla_put_be32(skb, NFTA_TUNNEL_KEY_ERSPAN_VERSION,
+				 htonl(opts->u.erspan.version)))
+			return -1;
 		switch (opts->u.erspan.version) {
 		case ERSPAN_VERSION:
 			if (nla_put_be32(skb, NFTA_TUNNEL_KEY_ERSPAN_V1_INDEX,