-
Notifications
You must be signed in to change notification settings - Fork 1.4k
modem_shell/serial_lte_modem: Replace IPPROTO_RAW with ETH_P_ALL #20977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
18b98d6 to
2f91c34
Compare
|
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 project with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 5b1426208a8791d910551f0edb87279a114e4369 more detailssdk-nrf:
zephyr:
Github labels
List of changed files detected by CI (15)Outputs:ToolchainVersion: 4ffa2202d5 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
You can find the documentation preview for this PR here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLM has tests for PPP, but only in nightly environment. Tried out these changes manually and it seems that PPP link can be brought up and data will flow through.
So seems to work correctly. In any case, now is a good time for this kind of change as we are actively working with SLM PPP.
The combination of AF_PACKET and IPPROTO_RAW is not correct as packet sockets should only be used with IEEE 802.3 protocol numbers. As the support for this combination will likely be soon removed from Zephyr, switch to use DGRAM packet socket instead. As PPP L2 only supports IP/IPv6 packets, specify the L2 protocol type field accordingly so that the L2 can interpret the packet data correctly. Signed-off-by: Robert Lubos <[email protected]>
The combination of AF_PACKET and IPPROTO_RAW is not correct as packet sockets should only be used with IEEE 802.3 protocol numbers. As the support for this combination will likely be soon removed from Zephyr, switch to use DGRAM packet socket instead. As PPP L2 only supports IP/IPv6 packets, specify the L2 protocol type field accordingly so that the L2 can interpret the packet data correctly. Signed-off-by: Robert Lubos <[email protected]>
2f91c34 to
5cda357
Compare
Outside of PPP, MOSH is using raw sockets by specifying
PPP is not covered in the integration CI but there is something in the nightly for MOSH PPP. We'll try to see if we can get that run somehow for a PPP image. @jhirsi, who would be more knowledgeable on this topic in our side, is out for this and next week but we'll try to handle this. |
Hmm, but from what I see this is only for modem sockets? Those shouldn't be affected by whatever changes are made in Zephyr. A separate question is whether such a combination is a valid one for the expected use case. After doing some research the conclusion is those RAW sockets are not well standardized and rather unportable. @jukkar has prepared a nice summary based on various sources: zephyrproject-rtos/zephyr#86827 (comment) |
Pull changes needed to make datagram packet sockets work with PPP L2. Signed-off-by: Robert Lubos <[email protected]>
5cda357 to
5b14262
Compare
|
Yep, that's only for modem sockets at the moment.
Nice summary.
Yep, modem should be just a passthrough. Good to know that this wouldn't work in a general manner and not without offloading. |
trantanen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving from modem_shell side. PPP nightly test passes.
Awesome, thanks 👍 |
|
There is a documentation page for how the user is supposed to use RAW sockets with the modem: https://github.com/nrfconnect/sdk-nrfxlib/blob/main//nrf_modem/doc/sockets/raw_sockets.rst. For a while Does it make sense for |
IMHO it'd be better to stick to the current behavior (0 as protocol wildcard). As I mentioned earlier, packet sockets are not really standardized so we can only rely on well-known implementations (like Linux), and according to their documentation of AF_PACKET (https://man7.org/linux/man-pages/man7/packet.7.html), protocol field should be:
And |
|
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time. |
|
Will come with the upmerge. |



It turns out that AF_PACKET and IPPROTO_RAW is not a valid combination (see zephyrproject-rtos/zephyr#86827) and will most likely be removed from Zephyr. An alternative for this would be to use AF_PACKET datagram socket with some extra tweaks specific for IP packet recognition in PPP L2 as proposed in this PR.
@nrfconnect/ncs-modem-tre Is PPP functionality in MoSH covered in Jenkins CI? I've tested the change on desk and it seems to work fine, although I would be more confident if this got some extra testing.
@nrfconnect/ncs-iot-oulu Same question - is PPP functionality in SLM covered in Jenkins? Unfortunately SLM refused to cooperate with me and I did not manage to verify this on desk, the change set is similar to MoSH though. It would be good to actually verify this however.