Skip to content
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

Use IP_RECVDSTADDR in absence of IP_PKTINFO #772

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

danielfr-haleytek
Copy link

@danielfr-haleytek danielfr-haleytek commented Oct 3, 2024

On FreeBSD-like network stacks, the socket option IP_PKTINFO is unavailable, but the option IP_RECVDSTADDR can be used instead.

This enables vsomeip for the new io-sock network stack on QNX 7.1+.

Co-author: Eric Sjöström eric.sjostrom@haleytek.com @EriComic

On FreeBSD-like network stacks, the socket option IP_PKTINFO is unavailable, but the option IP_RECVDSTADDR can be used instead.

This enables vsomeip for the new io-sock network stack on QNX 7.1+.

Co-author: Eric Sjöström <eric.sjostrom@haleytek.com> @EriComic
@duartenfonseca
Copy link
Collaborator

duartenfonseca commented Oct 7, 2024

@danielfr-haleytek can you rebase this? the value that you mentioned (IP_PKTINFO) that was hardcoded was just added to be able to build on QNX. if it makes sense for you to remove it, please make that change also on this PR

Change-Id: I53da16f0df5eac1577a789fa418b81bdb4dc2301
@danielfr-haleytek
Copy link
Author

@duartenfonseca: I just uploaded a new version with 3.5.1 merged.

@duartenfonseca
Copy link
Collaborator

@danielfr-haleytek can we just merge this one for now, for us to do some more internal testing? while keeping the SO_BINDTODEVICE part as is right now. I also added a question on the other PR

@danielfr-haleytek
Copy link
Author

danielfr-haleytek commented Oct 8, 2024

@duartenfonseca From our side, you can absolutely merge this PR, but we would recommend doing some basic testing (running your test suite) first as good practice. Please also note in particular:

  • We don't run 3.5.1, the PRs were tested on an older versions and the changes forward-ported. We have not tested the PRs with 3.5.1.
  • After applying this PR, I expect vsomeip to fail compiling on QNX with io-sock. This is due to SO_BINDTODEVICE not being defined (→ solved in Remove bind-to-device support where unavailable #773). For other platforms, compilation and functionality should not be affected.
  • We don't think defining SO_BINDTODEVICE yourself is a solution. Doing so while not patching the endpoint implementations will try to set an undefined socket option, which, in the best case, will just have no effect. It does not bring back the desired functionality.

@duartenfonseca
Copy link
Collaborator

@danielfr-haleytek yes we will first test both PR's internally, and then decide merging or not. I think it would make more sense like this. thanks for all your input (and EriComic).

for (struct cmsghdr *cmsg = CMSG_FIRSTHDR(&its_header);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&its_header, cmsg)) {

#if defined(IP_PKTINFO)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking, but can you add a small comment to the if/elif/else with the OS types that should go in that part of the code.
It will make life easier to new devs working on this part of the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants