summaryrefslogtreecommitdiff
path: root/net/udpcast/patches/patch-ab
blob: db28631d9705b62a26b5f9798c19521a91adaef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ab,v 1.2 2006/08/28 15:07:48 drochner Exp $

--- socklib.c.orig	2006-05-24 00:19:49.000000000 +0200
+++ socklib.c
@@ -879,6 +879,9 @@ int makeSocket(addr_type_t addr_type, 
     int ret, s;
     struct sockaddr_in myaddr;
     in_addr_t ip=0;
+#ifdef SO_REUSEPORT
+    int one = 1;
+#endif
 
 #ifdef WINDOWS
     static int lastSocket=-1;
@@ -897,6 +900,10 @@ int makeSocket(addr_type_t addr_type, 
 	exit(1);
     }
 
+#ifdef SO_REUSEPORT
+    ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one));
+#endif
+
     if(addr_type == ADDR_TYPE_MCAST && tmpl != NULL) {
 	ip = tmpl->sin_addr.s_addr;
     }