-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
socket_zep: only report size of single datagram #19121
Conversation
bors merge |
👎 Rejected by too few approved reviews |
A:
B:
Hmm, not really working for me. Might be an Arch issue. |
Uh turns out we end up here: https://github.com/RIOT-OS/RIOT/blob/master/cpu/native/socket_zep/socket_zep.c#L244 I guess discarding the frame if the radio is not in RX mode is not ideal, although I wonder why it's not in RX mode in the first place. |
f051baa
to
913d72c
Compare
it works now
|
What's the state here? I'm waiting on this for the next RC. @jia200x could you take a look? |
Does this still guarantee that each received frame triggers its corresponding RX Done event? If so, everything should be fine. |
Looks like the RX Done indication might be called more often, not less, so this should be good? |
bors merge |
It should be fine. As per Radio HAL documentation, the user of the HAL must call
No, there shouldn't be any automatic transition. But the user should call |
Hm maybe I had hoped |
18100: core/assert: print backtrace on failed assertion r=miri64 a=benpicco 19121: socket_zep: only report size of single datagram r=miri64 a=benpicco Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
This PR was included in a batch that was canceled, it will be automatically retried |
18100: core/assert: print backtrace on failed assertion r=benpicco a=benpicco 19121: socket_zep: only report size of single datagram r=miri64 a=benpicco 19164: cpu/sam0_common: move adc_res_t to common code r=dylad a=benpicco 19169: tests/driver_ws281x: don't overwrite board definition r=benpicco a=benpicco Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
This PR was included in a batch that was canceled, it will be automatically retried |
18100: core/assert: print backtrace on failed assertion r=kaspar030 a=benpicco 19121: socket_zep: only report size of single datagram r=miri64 a=benpicco 19164: cpu/sam0_common: move adc_res_t to common code r=dylad a=benpicco 19169: tests/driver_ws281x: don't overwrite board definition r=benpicco a=benpicco Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
bors cancel |
Canceled. |
Build succeeded: |
Contribution description
The use of
ioctl(zepdev->sock_fd, FIONREAD, &size)
would report the number of total bytes available on the socket. This could mean the cumulative sum of bytes of all datagrams, not just a single one.Instead, use
recv(zepdev->sock_fd, &hdr, sizeof(hdr), MSG_TRUNC | MSG_PEEK)
to only read the ZEP header (without consuming the datagram) to get the real size of the ZEP message.This prevents accidental concatenation of two ZEP packets into on, which with 6lo fragmentation, would cause the 2nd fragment to be lost as it is read together with the first fragment, but as part of the payload.
Testing procedure
Fragmented multicast datagrams should work now.
Issues/PRs references
fixes #19117