diff options
author | 2023-08-01 17:22:23 -0400 | |
---|---|---|
committer | 2023-08-03 15:05:41 +0200 | |
commit | 9f1179fbbd84d5269f57659152e24bd4b03fd095 (patch) | |
tree | 7dd4b368ab4ff5c74440475d672cfd611792f24f /kernel/bpf/helpers.c | |
parent | selftests: openvswitch: add an initial flow programming case (diff) | |
download | linux-rng-9f1179fbbd84d5269f57659152e24bd4b03fd095.tar.xz linux-rng-9f1179fbbd84d5269f57659152e24bd4b03fd095.zip |
selftests: openvswitch: support key masks
The default value for the mask actually depends on the value (e.g: if
the value is non-null, the default is full-mask), so change the convert
functions to accept the full, possibly masked string and let them figure
out how to parse the different values.
Also, implement size-aware int parsing.
With this patch we can now express flows such as the following:
"eth(src=0a:ca:fe:ca:fe:0a/ff:ff:00:00:ff:00)"
"eth(src=0a:ca:fe:ca:fe:0a)" -> mask = ff:ff:ff:ff:ff:ff
"ipv4(src=192.168.1.1)" -> mask = 255.255.255.255
"ipv4(src=192.168.1.1/24)"
"ipv4(src=192.168.1.1/255.255.255.0)"
"tcp(src=8080)" -> mask = 0xffff
"tcp(src=8080/0xf0f0)"
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'kernel/bpf/helpers.c')
0 files changed, 0 insertions, 0 deletions