Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Nov 12, 2024

Allow user to set the network interface for IPv6 and IPv4 multicast sockets.

rlubos
rlubos previously approved these changes Nov 12, 2024
@rlubos rlubos dismissed their stale review November 12, 2024 15:26

Too early...

@jukkar jukkar force-pushed the devel/add-ipv6-multicast-if-option branch 2 times, most recently from b8b05ac to 7ba4736 Compare November 15, 2024 15:13
@jukkar
Copy link
Member Author

jukkar commented Nov 15, 2024

  • updated according to comments
  • rebased against latest main
  • added support and tests for IP_MULTICAST_IF socket option

@jukkar jukkar changed the title Add support for IPV6_MULTICAST_IF socket option Add support for IPV6_MULTICAST_IF and IP_MULTICAST_IF socket options Nov 15, 2024
@jukkar jukkar force-pushed the devel/add-ipv6-multicast-if-option branch from 7ba4736 to 8ad8f38 Compare November 16, 2024 12:36
rlubos
rlubos previously approved these changes Nov 18, 2024
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

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

Looks good, just one suggestion.

Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <[email protected]>
Some of the network tests require that source and destination
addresses are not swapped so allow test to control the address
swapping from the test.

Signed-off-by: Jukka Rissanen <[email protected]>
Add tests that verify that IPV6_MULTICAST_IF socket option
set/get works as expected.

Signed-off-by: Jukka Rissanen <[email protected]>
Do the selection same way as in IPv6 so that if user supplies
unspecified destination address, the default interface is selected
the same way.

Signed-off-by: Jukka Rissanen <[email protected]>
This is helper is only needed in socket multicast interface selection
where we need to get one address from the interface so that it will
tell (when getsockopt() is used), the interface IPv4 address where
multicast packets will be sent. This is private function which is not
needed in public headers so place the prototype to net_private.h file.

Signed-off-by: Jukka Rissanen <[email protected]>
Allow user to set the network interface for multicast sockets
of type SOCK_DGRAM.

Signed-off-by: Jukka Rissanen <[email protected]>
Add tests that verify that IP_MULTICAST_IF socket option
set/get works as expected.

Signed-off-by: Jukka Rissanen <[email protected]>
Make sure that we cannot connect to IPv4 multicast or broadcast
destination address for a TCP socket.

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar jukkar force-pushed the devel/add-ipv6-multicast-if-option branch from 8ad8f38 to cb8144e Compare November 18, 2024 15:04
@jukkar
Copy link
Member Author

jukkar commented Nov 18, 2024

  • resolved merge conflicts
  • rebased to latest main

@jukkar jukkar requested a review from rlubos November 18, 2024 15:05
@jukkar
Copy link
Member Author

jukkar commented Nov 18, 2024

@pdgendt if you have time, please take a look, and thanks in advance!

@nashif nashif merged commit bffa312 into zephyrproject-rtos:main Nov 19, 2024
24 checks passed
@jukkar jukkar deleted the devel/add-ipv6-multicast-if-option branch November 19, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Networking area: POSIX POSIX API Library area: Sockets Networking sockets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants