Skip to content

Commit 7b3d2c6

Browse files
committed
Auto merge of #1184 - pusateri:recvif, r=gnzlbg
Add IP_RECVIF to BSD and IP_RECVDSTADDR to apple. FreeBSD/OpenBSD do not support IP_PKTINFO for IPv4 but use IP_RECVIF for interface index and IP_RECVDSTADDR for destination address. NetBSD and macOS also support IP_RECVIF and IP_RECVDSTADDR in addition to IP_PKTINFO. (For IPv6, all use IPV6_PKTINFO)
2 parents 16b6c0e + 3229fca commit 7b3d2c6

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,10 @@ pub const SOCK_RDM: ::c_int = 4;
15701570
pub const SOCK_SEQPACKET: ::c_int = 5;
15711571
pub const IP_TTL: ::c_int = 4;
15721572
pub const IP_HDRINCL: ::c_int = 2;
1573+
pub const IP_RECVDSTADDR: ::c_int = 7;
15731574
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
15741575
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
1576+
pub const IP_RECVIF: ::c_int = 20;
15751577
pub const IP_PKTINFO: ::c_int = 26;
15761578
pub const IP_RECVTOS: ::c_int = 27;
15771579
pub const IPV6_JOIN_GROUP: ::c_int = 12;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ pub const IP_RECVDSTADDR: ::c_int = 7;
664664
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
665665
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
666666
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
667+
pub const IP_RECVIF: ::c_int = 20;
667668
pub const IPV6_JOIN_GROUP: ::c_int = 12;
668669
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
669670
pub const IPV6_RECVPKTINFO: ::c_int = 36;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ pub const F_GETNOSIGPIPE: ::c_int = 13;
393393
pub const F_SETNOSIGPIPE: ::c_int = 14;
394394
pub const F_MAXFD: ::c_int = 11;
395395

396+
pub const IP_RECVIF: ::c_int = 20;
396397
pub const IP_PKTINFO: ::c_int = 25;
397398
pub const IP_RECVPKTINFO: ::c_int = 26;
398399
pub const IPV6_JOIN_GROUP: ::c_int = 12;

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ pub const IPPROTO_DIVERT: ::c_int = 258;
319319

320320
pub const IP_RECVDSTADDR: ::c_int = 7;
321321
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
322+
pub const IP_RECVIF: ::c_int = 30;
322323

323324
// sys/netinet/in.h
324325
pub const TCP_MD5SIG: ::c_int = 0x04;

0 commit comments

Comments
 (0)