lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun,  8 Dec 2019 12:41:32 +0800
From:   Xin Long <lucien.xin@...il.com>
To:     network dev <netdev@...r.kernel.org>,
        netfilter-devel@...r.kernel.org
Cc:     davem@...emloft.net, Pablo Neira Ayuso <pablo@...filter.org>
Subject: [PATCH nf-next 2/7] netfilter: nft_tunnel: parse VXLAN_GBP attr as u32 in nft_tunnel

Both user and kernel sides want VXLAN_GBP opt as u32, so there's no
need to convert it on each side.

Signed-off-by: Xin Long <lucien.xin@...il.com>
---
 net/netfilter/nft_tunnel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
index f76cd7d..d9d6c0d 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -239,7 +239,7 @@ static int nft_tunnel_obj_vxlan_init(const struct nlattr *attr,
 	if (!tb[NFTA_TUNNEL_KEY_VXLAN_GBP])
 		return -EINVAL;
 
-	opts->u.vxlan.gbp = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_VXLAN_GBP]));
+	opts->u.vxlan.gbp = nla_get_u32(tb[NFTA_TUNNEL_KEY_VXLAN_GBP]);
 
 	opts->len	= sizeof(struct vxlan_metadata);
 	opts->flags	= TUNNEL_VXLAN_OPT;
@@ -475,8 +475,8 @@ static int nft_tunnel_opts_dump(struct sk_buff *skb,
 		return -1;
 
 	if (opts->flags & TUNNEL_VXLAN_OPT) {
-		if (nla_put_be32(skb, NFTA_TUNNEL_KEY_VXLAN_GBP,
-				 htonl(opts->u.vxlan.gbp)))
+		if (nla_put_u32(skb, NFTA_TUNNEL_KEY_VXLAN_GBP,
+				opts->u.vxlan.gbp))
 			return -1;
 	} else if (opts->flags & TUNNEL_ERSPAN_OPT) {
 		switch (opts->u.erspan.version) {
-- 
2.1.0

Powered by blists - more mailing lists