diff options
author | Hou Tao <[email protected]> | 2024-12-06 19:06:14 +0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2024-12-06 09:14:25 -0800 |
commit | 156c977c539e87e173f505b23989d7b0ec0bc7d8 (patch) | |
tree | 1b3e5077c8522fe8112b843a9b54a8e593c4d06b /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | e2cf913314b9543f4479788443c7e9009c6c56d8 (diff) |
bpf: Remove unnecessary check when updating LPM trie
When "node->prefixlen == matchlen" is true, it means that the node is
fully matched. If "node->prefixlen == key->prefixlen" is false, it means
the prefix length of key is greater than the prefix length of node,
otherwise, matchlen will not be equal with node->prefixlen. However, it
also implies that the prefix length of node must be less than
max_prefixlen.
Therefore, "node->prefixlen == trie->max_prefixlen" will always be false
when the check of "node->prefixlen == key->prefixlen" returns false.
Remove this unnecessary comparison.
Reviewed-by: Toke Høiland-Jørgensen <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: Hou Tao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions