Re: [libnftnl PATCH] Partially revert "rule, set_elem: remove trailing \n in userdata snprintf"

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

 



On Tue, Oct 01, 2024 at 01:20:54PM +0200, Phil Sutter wrote:
> This reverts the rule-facing part of commit
> c759027a526ac09ce413dc88c308a4ed98b33416.
> 
> It can't be right: Rules without userdata are printed with a trailing
> newline, so this commit made behaviour inconsistent.

Did you run tests/py with this? It is the primary user for this.

> Fixes: c759027a526ac ("rule, set_elem: remove trailing \n in userdata snprintf")
> Signed-off-by: Phil Sutter <phil@xxxxxx>
> ---
>  src/rule.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/rule.c b/src/rule.c
> index 811d5a213f835..51d778d095317 100644
> --- a/src/rule.c
> +++ b/src/rule.c
> @@ -601,7 +601,7 @@ static int nftnl_rule_snprintf_default(char *buf, size_t remain,
>  			SNPRINTF_BUFFER_SIZE(ret, remain, offset);
>  		}
>  
> -		ret = snprintf(buf + offset, remain, " }");
> +		ret = snprintf(buf + offset, remain, " }\n");
>  		SNPRINTF_BUFFER_SIZE(ret, remain, offset);
>  
>  	}
> -- 
> 2.43.0
> 




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux