selftests/bpf: bring back (void *) cast to set_ipv4_csum in test_tc_tunnel
Subsystems (5)
PATCH 1/1 selftests/bpf: bring back (void *) cast to set_ipv4_csum in test_tc_tunnel
It was removed in commit 166b5a7f2ca3 ("selftests_bpf: extend test_tc_tunnel for UDP encap") without any explanation.
Otherwise I see:progs/test_tc_tunnel.c:160:17: warning: taking address of packed member 'ip' of class or structure
'v4hdr' may result in an unaligned pointer value [-Waddress-of-packed-member]
set_ipv4_csum(&h_outer.ip);
^~~~~~~~~~1 warning generated.
--- tools/testing/selftests/bpf/progs/test_tc_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/test_tc_tunnel.c +1 -1
@@ -157,7 +157,7 @@ static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto, bpf_ntohs(h_outer.ip.tot_len)); h_outer.ip.protocol = encap_proto; -set_ipv4_csum (&h_outer.ip); +set_ipv4_csum ((void *)&h_outer.ip);/* store new outer network header */ if (bpf_skb_store_bytes(skb, ETH_HLEN, &h_outer, olen,
Signature · 1 line
2.21.0.392.gf8f6787159e-goog
Quoted 9 lines · Stanislav Fomichev
It was removed in commit
166b5a7f2ca3("selftests_bpf: extendtest_tc_tunnelfor UDP encap") without any explanation.Otherwise I see:
progs/test_tc_tunnel.c:160:17: warning: taking address of packed member 'ip' of class or structure'v4hdr' may result in an unaligned pointer value [-Waddress-of-packed-member] set_ipv4_csum(&h_outer.ip); ^~~~~~~~~~
Quoted 6 lines
1 warning generated.
Cc Alan Maguire <[email protected]>Cc Willem de Bruijn <[email protected]>Fixes 166b5a7f2ca3 ("selftests_bpf: extend test_tc_tunnel for UDP encap")Signed-off-by Stanislav Fomichev <[email protected]>
Quoted 20 lines
--- tools/testing/selftests/bpf/progs/test_tc_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/progs/test_tc_tunnel.c +1
-2@@ -157,7 +157,7 @@ static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto, bpf_ntohs(h_outer.ip.tot_len)); h_outer.ip.protocol = encap_proto; -set_ipv4_csum (&h_outer.ip); +set_ipv4_csum ((void *)&h_outer.ip);/* store new outer network header */ if (bpf_skb_store_bytes(skb, ETH_HLEN, &h_outer, olen, --2.21.0.392.gf8f6787159e-goog
Alan Maguire
Reviewed-byQuoted 12 lines · Song Liu
Quoted 11 lines · Stanislav Fomichev
It was removed in commit
166b5a7f2ca3("selftests_bpf: extendtest_tc_tunnelfor UDP encap") without any explanation.Otherwise I see:
progs/test_tc_tunnel.c:160:17: warning: taking address of packed member 'ip' of class or structure'v4hdr' may result in an unaligned pointer value [-Waddress-of-packed-member] set_ipv4_csum(&h_outer.ip); ^~~~~~~~~~1 warning generated.
Quoted 7 lines
Quoted 4 lines
Cc Alan Maguire <[email protected]>Cc Willem de Bruijn <[email protected]>Fixes 166b5a7f2ca3 ("selftests_bpf: extend test_tc_tunnel for UDP encap")Signed-off-by Stanislav Fomichev <[email protected]>Acked-by Song Liu <[email protected]>
Thanks for fixing this Stanislav!
Quoted 21 lines
Quoted 20 lines
--- tools/testing/selftests/bpf/progs/test_tc_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/progs/test_tc_tunnel.c +1
-2@@ -157,7 +157,7 @@ static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto, bpf_ntohs(h_outer.ip.tot_len)); h_outer.ip.protocol = encap_proto; -set_ipv4_csum (&h_outer.ip); +set_ipv4_csum ((void *)&h_outer.ip);/* store new outer network header */ if (bpf_skb_store_bytes(skb, ETH_HLEN, &h_outer, olen, --2.21.0.392.gf8f6787159e-goog
Quoted 8 lines · Stanislav Fomichev
It was removed in commit
166b5a7f2ca3("selftests_bpf: extendtest_tc_tunnelfor UDP encap") without any explanation.Otherwise I see:
progs/test_tc_tunnel.c:160:17: warning: taking address of packed member 'ip' of class or structure'v4hdr' may result in an unaligned pointer value [-Waddress-of-packed-member] set_ipv4_csum(&h_outer.ip); ^~~~~~~~~~
Quoted 6 lines
1 warning generated.
Cc Alan Maguire <[email protected]>Cc Willem de Bruijn <[email protected]>Fixes 166b5a7f2ca3 ("selftests_bpf: extend test_tc_tunnel for UDP encap")Signed-off-by Stanislav Fomichev <[email protected]>
Applied, thanks!