]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: use __bpf_constant_htons in test_prog.c for flow dissector
authorStanislav Fomichev <sdf@google.com>
Wed, 27 Feb 2019 19:15:11 +0000 (11:15 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 28 Feb 2019 23:48:51 +0000 (00:48 +0100)
commit96ff5dcadb2365c75c95031f5699066f8a842931
treeaf47c4984dd7df6781c7954f75e082f3ef8d1123
parent5d087df70f7b95eff8844a72d771ddac479623fa
selftests/bpf: use __bpf_constant_htons in test_prog.c for flow dissector

Older GCC (<4.8) isn't smart enough to optimize !__builtin_constant_p()
branch in bpf_htons.

I recently fixed it for pkt_v4 and pkt_v6 in commit 50c04f2e70126
("selftests/bpf: use __bpf_constant_htons in test_prog.c"), but
later added another bunch of bpf_htons in commit 35f5e7641abf7
("selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow
dissector").

Fixes: 35f5e7641abf7 ("selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow dissector")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_progs.c