[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191211215211.rthtvxy7psglpdf5@salvia>
Date: Wed, 11 Dec 2019 22:52:11 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Xin Long <lucien.xin@...il.com>
Cc: network dev <netdev@...r.kernel.org>,
netfilter-devel@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH nf-next 2/7] netfilter: nft_tunnel: parse VXLAN_GBP attr
as u32 in nft_tunnel
On Sun, Dec 08, 2019 at 12:41:32PM +0800, Xin Long wrote:
> 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]);
In netfilter, attributes go in network byte order to make it easier to
send them over the wire. The only remaining part that needs to be
converted to network byte order is the netlink header.
Please, leave this one as is.
Powered by blists - more mailing lists