Skip to content

Commit 8fedb78

Browse files
Add IPV6_PKTINFO, Correct documentationn for IPV6_RECVPKTINFO (#2113)
* Add IPV6_PKTINFO, Correct documentationn for IPV6_RECVPKTINFO * Update src/sys/socket/sockopt.rs Co-authored-by: SteveLauC <[email protected]> * Update src/sys/socket/sockopt.rs Co-authored-by: SteveLauC <[email protected]> * revert documentation changes for IPV6_RECVPKTINFO * updated changelog --------- Co-authored-by: SteveLauC <[email protected]>
1 parent 0f53575 commit 8fedb78

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

changelog/2113.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add socket option `IPV6_PKTINFO` for BSDs/Linux/Android, also `IPV6_RECVPKTINFO` for DragonFlyBSD

src/sys/socket/sockopt.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ sockopt_impl!(
905905
libc::IP_PKTINFO,
906906
bool
907907
);
908-
#[cfg(any(linux_android, target_os = "freebsd", apple_targets, netbsdlike))]
908+
#[cfg(any(linux_android, bsd))]
909909
#[cfg(feature = "net")]
910910
sockopt_impl!(
911911
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
@@ -917,6 +917,19 @@ sockopt_impl!(
917917
libc::IPV6_RECVPKTINFO,
918918
bool
919919
);
920+
921+
#[cfg(any(linux_android, bsd))]
922+
#[cfg(feature = "net")]
923+
sockopt_impl!(
924+
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
925+
/// Pass an `IPV6_PKTINFO` ancillary message that contains a in6_pktinfo
926+
/// structure that supplies some information about the incoming packet.
927+
Ipv6PacketInfo,
928+
Both,
929+
libc::IPPROTO_IPV6,
930+
libc::IPV6_PKTINFO,
931+
bool
932+
);
920933
#[cfg(bsd)]
921934
#[cfg(feature = "net")]
922935
sockopt_impl!(

0 commit comments

Comments
 (0)