[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZK8FzXDVPPp4JNMq@corigine.com>
Date: Wed, 12 Jul 2023 20:58:05 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Ido Schimmel <idosch@...dia.com>
Cc: netdev@...r.kernel.org, stephen@...workplumber.org, dsahern@...il.com,
petrm@...dia.com, lukasz.czapnik@...el.com
Subject: Re: [PATCH iproute2] f_flower: Treat port 0 as valid
On Tue, Jul 11, 2023 at 09:59:03AM +0300, Ido Schimmel wrote:
> It is not currently possible to add a filter matching on port 0 despite
> it being a valid port number. This is caused by cited commit which
> treats a value of 0 as an indication that the port was not specified.
>
> Instead of inferring that a port range was specified by checking that both
> the minimum and the maximum ports are non-zero, simply add a boolean
> argument to parse_range() and set it after parsing a port range.
>
> Before:
>
> # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp src_port 0 action pass
> Illegal "src_port"
>
> # tc filter add dev swp1 ingress pref 2 proto ip flower ip_proto udp dst_port 0 action pass
> Illegal "dst_port"
>
> # tc filter add dev swp1 ingress pref 3 proto ip flower ip_proto udp src_port 0-100 action pass
> Illegal "src_port"
>
> # tc filter add dev swp1 ingress pref 4 proto ip flower ip_proto udp dst_port 0-100 action pass
> Illegal "dst_port"
>
> After:
>
> # tc filter add dev swp1 ingress pref 1 proto ip flower ip_proto udp src_port 0 action pass
>
> # tc filter add dev swp1 ingress pref 2 proto ip flower ip_proto udp dst_port 0 action pass
>
> # tc filter add dev swp1 ingress pref 3 proto ip flower ip_proto udp src_port 0-100 action pass
>
> # tc filter add dev swp1 ingress pref 4 proto ip flower ip_proto udp dst_port 0-100 action pass
>
> # tc filter show dev swp1 ingress | grep _port
> src_port 0
> dst_port 0
> src_port 0-100
> dst_port 0-100
>
> Fixes: 767b6fd620dd ("tc: flower: fix port value truncation")
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> Reviewed-by: Petr Machata <petrm@...dia.com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists