gnrc_sock: consider all pktsnip for gnrc_neterr reporting#12682
gnrc_sock: consider all pktsnip for gnrc_neterr reporting#12682miri64 merged 2 commits intoRIOT-OS:masterfrom
Conversation
970362d to
fc74f2e
Compare
|
I'd say this also fixes #11551 (although an update to the documentation of I can confirm that the errors are now reported properly and not silently dropped. |
What do you have in mind? At least |
We shouldn't be overly cryptic to our users just for the sake of … not leaking abstractions in documentation? would not hurt and avoid surprises. |
This is as cryptic as not talking about GNRC, if a user does not know about GNRC ( |
If that's the right place for it, sure!
But please don't be so vague. Right now it reads
And then a list of possible errors that only get reported if |
Untrue, when using |
But yes, I'll try to be less vague. |
benpicco
left a comment
There was a problem hiding this comment.
Errors are now properly reported when gnrc_neterr is used.
Code looks alright too.
As analyzed in RIOT-OS#12678 there are cases where different reports can be generated for the different snips of the packet send via the `sock`. To catch all errors generated by the stack, the sock has to subscribe for all snips of the packet sent. If any of the snips reports an error distinct from `GNRC_NETERR_SUCCESS` or the previous one, we report that status instead of just the first we receive. This way we are ensured to have the first error reported by the stack for the given packet.
fc74f2e to
8992dce
Compare
|
Added a suppression comment for the |
Contribution description
As analyzed in #12678 (comment) there are cases where different reports can be generated for the different snips of the packet send via the
sock.To catch all errors generated by the stack, the sock has to subscribe for all snips of the packet sent. If any of the snips reports an error distinct from
GNRC_NETERR_SUCCESSor the previous one, we report that status instead of just the first we receive. This way we are ensured to have the first error reported by the stack for the given packet.Testing procedure
Merge #12678 into this PR, set
ENABLE_DEBUG=1insys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c(fix for debug messages piggy-backed) and run the test for several scenarios: It should succeed or fail, but with good reason. E.g.Vanilla (no interfaces)
With an IEEE 802.15.4 interface (i.e. using 6Lo-ND)
(first send succeeds as the link-local packet is actually send due to address resolution by reverse translation, second fails with
-ENETUNREACH, as the non-existing route is looked up as with vanilla)With an Ethernet interface
(node tries to probe for neighbor several times before finally reporting
EHOSTUNREACHfor the first, for the secondENETUNREACHis again reported, as the non-existing route is looked up as with vanillaIssues/PRs references
Discovered in #12678.
Fixes #11551.