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

Pktinfo #1021

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

Pktinfo #1021

wants to merge 8 commits into from

Conversation

funman
Copy link
Contributor

@funman funman commented Sep 13, 2024

Sets interface index for each uref on udp source

TODO:

  • udp sink
  • source address per uref?
  • ipv6

To enable this, the socket option IP_PKTINFO must be set first:

    int fd;
    ubase_assert(upipe_udpsrc_get_fd(upipe_udpsrc, &fd));
    const int yes = 1;
    if (setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &yes, sizeof(yes)) < 0) {
        perror("setsockopt");
        return 1;
    }
Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API
We need to set the source address

Also sets cmsg correctly
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.

1 participant