Re: [libnftnl PATCH 1/3] expr: masq: optional printing of flags attr in snprintf_default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 02, 2014 at 01:58:36PM +0200, Arturo Borrero Gonzalez wrote:
> The flags attribute is optional. Thus we should print only if it
> was originally set.

Applied with nitpick.

> Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
> ---
>  0 files changed
> 
> diff --git a/src/expr/masq.c b/src/expr/masq.c
> index 6a1c609..c8a6a8d 100644
> --- a/src/expr/masq.c
> +++ b/src/expr/masq.c
> @@ -169,8 +169,10 @@ static int nft_rule_expr_masq_snprintf_default(char *buf, size_t len,
>  {
>  	struct nft_expr_masq *masq = nft_expr_data(e);
>  
> -	return snprintf(buf, len, " flags %u ",
> -			 masq->flags);
> +	if (e->flags & (1 << NFT_EXPR_MASQ_FLAGS))
> +		return snprintf(buf, len, "flags %u", masq->flags);
                                                   ^
                                      missing space there.

Otherwise the output shows flags 0].

And change it to use %x. Hex is better for flags.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux