]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Omit superfluous address family check in __bpf_skc_lookup
authorTobias Klauser <tklauser@distanz.ch>
Thu, 30 Jun 2022 08:26:18 +0000 (10:26 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 5 Jul 2022 09:51:30 +0000 (11:51 +0200)
commit1d20a0eaa0f1a698f26cd99779cdc1a231eb5a1e
treec6514f108386fd60ce0450ac34c5ae767036e6e6
parente0bce37bc3e4f7aa6c54a1a3ed874e2aa8aa6df0
bpf: Omit superfluous address family check in __bpf_skc_lookup

family is only set to either AF_INET or AF_INET6 based on len. In all
other cases we return early. Thus the check against AF_UNSPEC can be
omitted.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220630082618.15649-1-tklauser@distanz.ch
net/core/filter.c