Re: [nft PATCH] main: Fix for misleading error with negative chain priority

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

 



On Mon, Oct 21, 2019 at 06:56:03PM +0200, Phil Sutter wrote:
> getopt_long() would try to parse the negative priority as an option and
> return -1 as it is not known:
> 
> | # nft add chain x y { type filter hook input priority -30\; }
> | nft: invalid option -- '3'
> 
> Fix this by prefixing optstring with a plus character. This instructs
> getopt_long() to not collate arguments but just stop after the first
> non-option, leaving the rest for manual handling. In fact, this is just
> what nft desires: mixing options with nft syntax leads to confusive
> command lines anyway.
>
> Signed-off-by: Phil Sutter <phil@xxxxxx>

Acked-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>



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

  Powered by Linux