Skip to content

Commit

Permalink
Add IPV6_PKTINFO, Correct documentationn for IPV6_RECVPKTINFO (#2113)
Browse files Browse the repository at this point in the history
* Add IPV6_PKTINFO, Correct documentationn for IPV6_RECVPKTINFO

* Update src/sys/socket/sockopt.rs

Co-authored-by: SteveLauC <stevelauc@outlook.com>

* Update src/sys/socket/sockopt.rs

Co-authored-by: SteveLauC <stevelauc@outlook.com>

* revert documentation changes for IPV6_RECVPKTINFO

* updated changelog

---------

Co-authored-by: SteveLauC <stevelauc@outlook.com>
  • Loading branch information
ishanjain28 and SteveLauC committed Jun 27, 2024
1 parent 0f53575 commit 8fedb78
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/2113.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add socket option `IPV6_PKTINFO` for BSDs/Linux/Android, also `IPV6_RECVPKTINFO` for DragonFlyBSD
15 changes: 14 additions & 1 deletion src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ sockopt_impl!(
libc::IP_PKTINFO,
bool
);
#[cfg(any(linux_android, target_os = "freebsd", apple_targets, netbsdlike))]
#[cfg(any(linux_android, bsd))]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
Expand All @@ -917,6 +917,19 @@ sockopt_impl!(
libc::IPV6_RECVPKTINFO,
bool
);

#[cfg(any(linux_android, bsd))]
#[cfg(feature = "net")]
sockopt_impl!(
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
/// Pass an `IPV6_PKTINFO` ancillary message that contains a in6_pktinfo
/// structure that supplies some information about the incoming packet.
Ipv6PacketInfo,
Both,
libc::IPPROTO_IPV6,
libc::IPV6_PKTINFO,
bool
);
#[cfg(bsd)]
#[cfg(feature = "net")]
sockopt_impl!(
Expand Down

0 comments on commit 8fedb78

Please sign in to comment.