bpf: misc ICMPv6 ND fixes (srcip, nollsrcopt...)#36024
Conversation
|
Please note commit 8f43383 makes these two BPF tests fail: I can't see anything "problematic" in |
ebead7f to
6870183
Compare
|
checkpatch warnings and errors should be fixed now. |
6870183 to
009a04d
Compare
gentoo-root
left a comment
There was a problem hiding this comment.
Looks good to me in general; I haven't analyzed the CI failures (yet?).
009a04d to
1a88234
Compare
There was a problem hiding this comment.
I can't see anything "problematic" in
icmpv6.h, so I suspect it has more to do with the tests themselves. I would appreciate some guidance on this, cc @ti-mo.
There's indeed nothing problematic in linux/icmpv6.h. fib_tests.c has had some data in .bss since forever, redir_recorder and redir_neigh_recorder are global vars:
~ llvm-objdump -SD bpf/tests/fib_tests.o
[...]
Disassembly of section .bss:
0000000000000000 <redir_recorder>:
...
0000000000000018 <redir_neigh_recorder>:
...
The inliner happily accepted it since bpf tests all override configurables like THIS_INTERFACE_MAC using compile-time macros, meaning there are no references to .rodata.config. This makes the following statement return early:
Lines 437 to 441 in 11da06e
.. so the .bss reference doesn't trigger the error.
With the guard removed, lib/icmp6.h is compiled in unconditionally, creating a reference to .rodata.config, triggering the inliner. I'm removing this restriction in #35988 if you can wait.
Keep in mind the removal of the ifdef cannot be backported for this reason, so best to drop the change or send it as a separate PR. It will need to happen at some point if we ever want to go clang-free at runtime anyway.
Thx @ti-mo
Yeah, maybe it's a good. Idea; I wanted to see whether there was a way to fix the code in either icmpv6.h or those two tests, and already integrate it, but seems a futile job if #35988 makes it in. I will add it as part of #34983 (which is where originally was). |
1a88234 to
97a44c2
Compare
|
/test |
1 similar comment
|
/test |
97a44c2 to
c9eb43b
Compare
|
Rebased as all integration/conformance tests were failing on the Envoy thing... |
|
/test |
|
@msune is this ready to merge? Looks like convo with Timo is still going on. If its not, please remove the ready-to-merge label. |
I am awaiting input from @ti-mo on the
I can't, neither trigger the CI (not a cilium project member). Sad.. 😂 |
I thought we moved to If there are leftovers, they should be cleaned up. |
Thx, I didn't know that. I will move to |
Head branch was pushed to by a user without write access
c9eb43b to
6d0068d
Compare
|
@dylandreimerink any thoughts on test coverage per the prior comment? #36024 (comment) |
I think the changes to the tests seem great. Having the common parts as functions like this seems neat.
I think we have test cases for the behavior we are interested in, but its hard to say from just reading the code if this covers all of the logic we have. This PR will definitely be an improvement over the current situation. |
2f25345 to
742178c
Compare
|
Rebased, removed Draft again. As I was saying here I would feel more comfortable if someone would answer question 2). But at this point feel free to merge, and we shall see I guess. (Give me 30min to fix checkpatch warnings on the rebase) |
Note the I am just moving it to a different location in the file for readability. |
rgo3
left a comment
There was a problem hiding this comment.
Looks like I don't own any of the files in this PR, so removing myself as reviewer. As a side note, this PR will probably need a rebase after #38244 goes in (would also solve the checkpatch complaint I think). Or vice versa of course.
742178c to
742d9ee
Compare
|
/test |
742d9ee to
d15b163
Compare
|
/test |
Prior to this commit, Neighbour Solicitation replies (Neighbour Advertisments) were sent from ROUTER_IP. RFC4861, section 4.4 explicitly mentions that the Source Address must be: > An address assigned to the interface from which the advertisement > is sent. In addition, the current BPF ARP implementation returns the ARP header with the target_ip as source IP. This commit changes the current implementation of icmp6_send_reply() to use the target_ip as source IP of ICMP NA messages. Signed-off-by: Marc Suñé <[email protected]> Signed-off-by: Timo Beckers <[email protected]>
This commit refactors and adds two more tests to ipv6_ndp_from_netdev_test.c covering multicast (broadcast) IPv6 neighbour solicitation, both for node IPs (to stack) and for endpoints (BPF). Signed-off-by: Marc Suñé <[email protected]> Signed-off-by: Timo Beckers <[email protected]>
Prior to this commit, the ICMPv6 Neighbour Solicitation BPF responder (Pods) implementation assumed that the Link Layer Source Address option was **always** present in the packet. According to spec, this option is - actually - optional for NS messages, and SHALL NOT be used in particular cases: > According to RFC4861, sections 4.3 and 7.2.2 unicast neighbour > solicitations (reachability check) SHOULD but are NOT REQUIRED to > include the SRC_LL_ADDR option in the NS message. > > Likewise, neighbour solicitations during Duplicate Address Detection > (DAD, RFC4862), SRC_LL_ADDR option must not present. This resulted in NS messages being dropped when attempting to access LLSRC option (out of bounds check). This commit: * Fixes handling of ICMPv6 NS packets by allocating via ctx_change_tail() enough space for LL_SRC option when not originally present. * Adds test coverage for all combinations Targeted/Bcast, Node/Pod and w/ and w/o LL_SRC option. Signed-off-by: Marc Suñé <[email protected]> Signed-off-by: Timo Beckers <[email protected]>
Remove redundancy in test code for ICMPv6, partially existent and partially introduced in previous commits. Add some more assertions e.g. ICMPv6 type/length. Signed-off-by: Marc Suñé <[email protected]> Signed-off-by: Timo Beckers <[email protected]>
d15b163 to
3317a6a
Compare
|
/test Rebased to pick up #38566. |
|
It looks like we missed the release note here in the PR description before merging. I've taken a stab at updating it, please double check it and fix it if I got it wrong. |
(Stubbed / dependency of PR #34983)
This patchset:
See commit logs for details.