Thread (7 messages) flat view 7 messages, 3 authors, 2018-12-12

Re: [PATCH v2 bpf-next] selftests/bpf: use __bpf_constant_htons in test_prog.c

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-12-12 09:50:45

On 12/12/2018 04:20 AM, Stanislav Fomichev wrote:
For some reason, my older GCC (< 4.8) isn't smart enough to optimize the
!__builtin_constant_p() branch in bpf_htons, I see:
  error: implicit declaration of function '__builtin_bswap16'

Let's use __bpf_constant_htons as suggested by Daniel Borkmann.

I tried to use simple htons, but it produces the following:
  test_progs.c:54:17: error: braced-group within expression allowed only
  inside a function
    .eth.h_proto = htons(ETH_P_IP),

Signed-off-by: Stanislav Fomichev <redacted>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help