opnsense-ports/devel/electron22/files/patch-net_socket_udp__socket__posix.cc
Franco Fichtner d016c42591 */*: sync with upstream
Taken from: FreeBSD
2023-01-30 10:59:54 +01:00

29 lines
1 KiB
C++

--- net/socket/udp_socket_posix.cc.orig 2022-10-24 13:33:33 UTC
+++ net/socket/udp_socket_posix.cc
@@ -558,7 +558,7 @@ int UDPSocketPosix::SetDoNotFragment() {
}
void UDPSocketPosix::SetMsgConfirm(bool confirm) {
-#if !BUILDFLAG(IS_APPLE)
+#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_BSD)
if (confirm) {
sendto_flags_ |= MSG_CONFIRM;
} else {
@@ -579,7 +579,7 @@ int UDPSocketPosix::SetBroadcast(bool broadcast) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
int value = broadcast ? 1 : 0;
int rv;
-#if BUILDFLAG(IS_APPLE)
+#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
// SO_REUSEPORT on OSX permits multiple processes to each receive
// UDP multicast or broadcast datagrams destined for the bound
// port.
@@ -892,7 +892,7 @@ int UDPSocketPosix::DoBind(const IPEndPoint& address)
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (last_error == EINVAL)
return ERR_ADDRESS_IN_USE;
-#elif BUILDFLAG(IS_APPLE)
+#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
if (last_error == EADDRNOTAVAIL)
return ERR_ADDRESS_IN_USE;
#endif