Skip to content

Commit

Permalink
Fix IPv6 SD (#462)
Browse files Browse the repository at this point in the history
Co-authored-by: Julius Gesang <julius.gesang@micronova.de>
  • Loading branch information
Herobone and Julius Gesang committed Oct 23, 2023
1 parent 91805d8 commit 3230caf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ struct udp_server_endpoint_impl_receive_op {
boost::asio::ip::address_v6::bytes_type its_bytes;

// sender
boost::asio::ip::address_v6 its_sender_address;
for (size_t i = 0; i < its_bytes.size(); i++)
its_bytes[i] = addr.v6.sin6_addr.s6_addr[i];
boost::asio::ip::address_v6 its_sender_address(its_bytes);
in_port_t its_sender_port(ntohs(addr.v6.sin6_port));
sender_ = endpoint_type_t(its_sender_address, its_sender_port);

Expand Down
2 changes: 1 addition & 1 deletion implementation/endpoints/src/udp_server_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ udp_server_endpoint_impl::set_multicast_option(
int its_pktinfo_option(1);
::setsockopt(multicast_socket_->native_handle(),
(is_v4_ ? IPPROTO_IP : IPPROTO_IPV6),
(is_v4_ ? IP_PKTINFO : IPV6_PKTINFO),
(is_v4_ ? IP_PKTINFO : IPV6_RECVPKTINFO),
&its_pktinfo_option, sizeof(its_pktinfo_option));
#endif

Expand Down

0 comments on commit 3230caf

Please sign in to comment.