-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mDNSResponder: Fix build in IPv6 environment
- Restore patch-mDNSPosix-mDNSPosix.c which was removed by accident in 1790.80.10 update - Bump PORTREVISION for package change PR: 270683, 270689 Reported by: Matthieu Volat <mazhe@alkumuna.eu>, <dougs@dawnsign.com>
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- mDNSPosix/mDNSPosix.c.orig 2023-01-24 00:43:17 UTC | ||
+++ mDNSPosix/mDNSPosix.c | ||
@@ -1064,7 +1064,10 @@ mDNSlocal int SetupIPv6Socket(int fd) | ||
{ | ||
int err; | ||
|
||
- #if defined(IPV6_PKTINFO) | ||
+ #if defined(IPV6_RECVPKTINFO) | ||
+ err = setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &kOn, sizeof(kOn)); | ||
+ if (err < 0) { err = errno; perror("setsockopt - IPV6_RECVPKTINFO"); } | ||
+ #elif defined(IPV6_PKTINFO) | ||
err = setsockopt(fd, IPPROTO_IPV6, IPV6_2292_PKTINFO, &kOn, sizeof(kOn)); | ||
if (err < 0) { err = errno; perror("setsockopt - IPV6_PKTINFO"); } | ||
#else | ||
@@ -1135,7 +1138,7 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, m | ||
// to bind to the socket. Our suggestion was to switch the order in which | ||
// SO_REUSEPORT and SO_REUSEADDR was tested so that SO_REUSEADDR stays on | ||
// top and SO_REUSEPORT to be used only if SO_REUSEADDR doesn't exist. | ||
- #if defined(SO_REUSEADDR) && !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) | ||
+ #if defined(SO_REUSEADDR) && !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && !defined(__FreeBSD__) | ||
err = setsockopt(*sktPtr, SOL_SOCKET, SO_REUSEADDR, &kOn, sizeof(kOn)); | ||
#elif defined(SO_REUSEPORT) | ||
err = setsockopt(*sktPtr, SOL_SOCKET, SO_REUSEPORT, &kOn, sizeof(kOn)); | ||
@@ -1224,7 +1227,13 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, m | ||
if (err == 0) { | ||
err = SetupIPv6Socket(*sktPtr); | ||
} | ||
- #if defined(IPV6_HOPLIMIT) | ||
+ #if defined(IPV6_RECVHOPLIMIT) | ||
+ if (err == 0) | ||
+ { | ||
+ err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &kOn, sizeof(kOn)); | ||
+ if (err < 0) { err = errno; perror("setsockopt - IPV6_RECVHOPLIMIT"); } | ||
+ } | ||
+ #elif defined(IPV6_HOPLIMIT) | ||
if (err == 0) | ||
{ | ||
err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_2292_HOPLIMIT, &kOn, sizeof(kOn)); |