Mon Dec 5 22:46:12 2011 UTC ()
Don't use "false" as variable name.


(joerg)
diff -r1.6 -r1.7 pkgsrc/games/quake6/distinfo
diff -r1.1 -r1.2 pkgsrc/games/quake6/patches/patch-aj

cvs diff -r1.6 -r1.7 pkgsrc/games/quake6/distinfo (expand / switch to unified diff)

--- pkgsrc/games/quake6/distinfo 2006/01/22 21:27:21 1.6
+++ pkgsrc/games/quake6/distinfo 2011/12/05 22:46:12 1.7
@@ -1,15 +1,16 @@ @@ -1,15 +1,16 @@
1$NetBSD: distinfo,v 1.6 2006/01/22 21:27:21 wiz Exp $ 1$NetBSD: distinfo,v 1.7 2011/12/05 22:46:12 joerg Exp $
2 2
3SHA1 (quake-v6-bsd-kame.tar.gz) = 09d58eef39f3d8a6b7b7287c88fc66d4dd3feb0b 3SHA1 (quake-v6-bsd-kame.tar.gz) = 09d58eef39f3d8a6b7b7287c88fc66d4dd3feb0b
4RMD160 (quake-v6-bsd-kame.tar.gz) = 1844e193b62886c452a65c5c5780f58d19684109 4RMD160 (quake-v6-bsd-kame.tar.gz) = 1844e193b62886c452a65c5c5780f58d19684109
5Size (quake-v6-bsd-kame.tar.gz) = 4503326 bytes 5Size (quake-v6-bsd-kame.tar.gz) = 4503326 bytes
6SHA1 (patch-aa) = a52444f89a06fd3de78942f6e7de10daf403301b 6SHA1 (patch-aa) = a52444f89a06fd3de78942f6e7de10daf403301b
7SHA1 (patch-ab) = 418d3f9c1bcc53a68ab7da87a40413eb9adb41da 7SHA1 (patch-ab) = 418d3f9c1bcc53a68ab7da87a40413eb9adb41da
8SHA1 (patch-ac) = 26a88941cbc5aaaf1fe4993e7e5143f86a22d96a 8SHA1 (patch-ac) = 26a88941cbc5aaaf1fe4993e7e5143f86a22d96a
9SHA1 (patch-ad) = c37c599f2e9388fb5caba6228dc2a021149d2320 9SHA1 (patch-ad) = c37c599f2e9388fb5caba6228dc2a021149d2320
10SHA1 (patch-ae) = 89328f2f9f8ebe2645b8612ed6b6ca2849494051 10SHA1 (patch-ae) = 89328f2f9f8ebe2645b8612ed6b6ca2849494051
11SHA1 (patch-af) = 3dd7bf9a44a4e087e09e758b53c69406e1468121 11SHA1 (patch-af) = 3dd7bf9a44a4e087e09e758b53c69406e1468121
12SHA1 (patch-ag) = d7821ab0e335b4e35e9721797b1cd5aa1ab8ee45 12SHA1 (patch-ag) = d7821ab0e335b4e35e9721797b1cd5aa1ab8ee45
13SHA1 (patch-ah) = cba95c90176666b302288ff4e9dc1d292c512a2b 13SHA1 (patch-ah) = cba95c90176666b302288ff4e9dc1d292c512a2b
14SHA1 (patch-ai) = 0d1864f671a8db635564c4ff734c278d9a3989c9 14SHA1 (patch-ai) = 0d1864f671a8db635564c4ff734c278d9a3989c9
15SHA1 (patch-aj) = a754b5c78c5e81d4103276332f4a0bb3160770aa 15SHA1 (patch-aj) = 42fca68c85c65fa3edaec20638f318f9d914c424
 16SHA1 (patch-aj.diff) = 3fe79f648669d43e5610a3ddeb478adaf355b538

cvs diff -r1.1 -r1.2 pkgsrc/games/quake6/patches/patch-aj (expand / switch to unified diff)

--- pkgsrc/games/quake6/patches/patch-aj 2002/01/10 16:43:29 1.1
+++ pkgsrc/games/quake6/patches/patch-aj 2011/12/05 22:46:12 1.2
@@ -1,36 +1,36 @@ @@ -1,36 +1,36 @@
1$NetBSD: patch-aj,v 1.1 2002/01/10 16:43:29 skrll Exp $ 1$NetBSD: patch-aj,v 1.2 2011/12/05 22:46:12 joerg Exp $
2 2
3--- uquake/net_udp.c.orig Mon Jan 10 16:59:39 2000 3--- uquake/net_udp.c.orig 2000-01-10 16:59:39.000000000 +0000
4+++ uquake/net_udp.c 4+++ uquake/net_udp.c
5@@ -32,12 +32,17 @@ 5@@ -32,12 +32,17 @@ Foundation, Inc., 59 Temple Place - Suit
6 #include <sys/param.h> 6 #include <sys/param.h>
7 #include <sys/ioctl.h> 7 #include <sys/ioctl.h>
8 #include <errno.h> 8 #include <errno.h>
9+#include <net/if.h> 9+#include <net/if.h>
10  10
11 #ifdef __sun__ 11 #ifdef __sun__
12 #include <sys/filio.h> 12 #include <sys/filio.h>
13 #undef model_t 13 #undef model_t
14 #endif 14 #endif
15  15
16+#ifndef INADDR_LOOPBACK 16+#ifndef INADDR_LOOPBACK
17+#define INADDR_LOOPBACK (u_int32_t)0x7f000001 17+#define INADDR_LOOPBACK (u_int32_t)0x7f000001
18+#endif 18+#endif
19+ 19+
20 #if defined(sgi) && defined(sa_family) 20 #if defined(sgi) && defined(sa_family)
21 /* Get rid of problematic SGI #def */ 21 /* Get rid of problematic SGI #def */
22 #undef sa_family 22 #undef sa_family
23@@ -62,6 +67,91 @@ 23@@ -62,6 +67,91 @@ static unsigned long myAddr;
24 #include "net_udp.h" 24 #include "net_udp.h"
25  25
26 //============================================================================= 26 //=============================================================================
27+/* get any of my non-loopback addr. */ 27+/* get any of my non-loopback addr. */
28+static int 28+static int
29+grab_myaddr(family, sa) 29+grab_myaddr(family, sa)
30+ int family; 30+ int family;
31+ struct sockaddr *sa; 31+ struct sockaddr *sa;
32+{ 32+{
33+ int s; 33+ int s;
34+ unsigned int maxif; 34+ unsigned int maxif;
35+ struct ifreq *iflist; 35+ struct ifreq *iflist;
36+ struct ifconf ifconf; 36+ struct ifconf ifconf;
@@ -102,82 +102,82 @@ $NetBSD: patch-aj,v 1.1 2002/01/10 16:43 @@ -102,82 +102,82 @@ $NetBSD: patch-aj,v 1.1 2002/01/10 16:43
102+ else { 102+ else {
103+ printf("non-printable local address, family %d\n", 103+ printf("non-printable local address, family %d\n",
104+ family); 104+ family);
105+ } 105+ }
106+ } 106+ }
107+ break; 107+ break;
108+ } 108+ }
109+ 109+
110+ free(iflist); 110+ free(iflist);
111+} 111+}
112  112
113 int UDP_Init (void) 113 int UDP_Init (void)
114 { 114 {
115@@ -74,9 +164,18 @@ 115@@ -74,9 +164,18 @@ int UDP_Init (void)
116 return -1; 116 return -1;
117  117
118 // determine my name & address 118 // determine my name & address
119+ memset(&myAddr, 0, sizeof(myAddr)); 119+ memset(&myAddr, 0, sizeof(myAddr));
120+#if 0 120+#if 0
121 gethostname(buff, MAXHOSTNAMELEN); 121 gethostname(buff, MAXHOSTNAMELEN);
122 local = gethostbyname(buff); 122 local = gethostbyname(buff);
123 myAddr = *(int *)local->h_addr_list[0]; 123 myAddr = *(int *)local->h_addr_list[0];
124+#else 124+#else
125+ { 125+ {
126+ struct sockaddr_in sin; 126+ struct sockaddr_in sin;
127+ if (grab_myaddr(AF_INET, (struct sockaddr *)&sin) == 0) 127+ if (grab_myaddr(AF_INET, (struct sockaddr *)&sin) == 0)
128+ memcpy(&myAddr, &sin.sin_addr, sizeof(myAddr)); 128+ memcpy(&myAddr, &sin.sin_addr, sizeof(myAddr));
129+ } 129+ }
130+#endif 130+#endif
131  131
132 // if the quake hostname isn't set, set it to the machine name 132 // if the quake hostname isn't set, set it to the machine name
133 if (Q_strcmp(hostname.string, "UNNAMED") == 0) 133 if (Q_strcmp(hostname.string, "UNNAMED") == 0)
134@@ -137,25 +236,45 @@ 134@@ -137,25 +236,45 @@ void UDP_Listen (qboolean state)
135  135
136 int UDP_OpenSocket (int port) 136 int UDP_OpenSocket (int port)
137 { 137 {
138+ struct addrinfo hints, *res = NULL; 138+ struct addrinfo hints, *res = NULL;
139+ int error; 139+ int error;
140+ char pbuf[NI_MAXSERV]; 140+ char pbuf[NI_MAXSERV];
141 int newsocket; 141 int newsocket;
142- struct sockaddr_in address; 142- struct sockaddr_in address;
143 qboolean _true = true; 143 qboolean _true = true;
144+ const int false = 0; 144+ const int wrong = 0;
145  145
146- if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) 146- if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
147+ snprintf(pbuf, sizeof(pbuf), "%d", port); 147+ snprintf(pbuf, sizeof(pbuf), "%d", port);
148+ memset(&hints, 0, sizeof(hints)); 148+ memset(&hints, 0, sizeof(hints));
149+ hints.ai_family = PF_INET6; 149+ hints.ai_family = PF_INET6;
150+ hints.ai_socktype = SOCK_DGRAM; 150+ hints.ai_socktype = SOCK_DGRAM;
151+ hints.ai_flags = AI_PASSIVE; 151+ hints.ai_flags = AI_PASSIVE;
152+ error = getaddrinfo(NULL, pbuf, &hints, &res); 152+ error = getaddrinfo(NULL, pbuf, &hints, &res);
153+ if (error) 153+ if (error)
154 return -1; 154 return -1;
155  155
156- if (ioctl (newsocket, FIONBIO, (char *)&_true) == -1) 156- if (ioctl (newsocket, FIONBIO, (char *)&_true) == -1)
157+ if ((newsocket = socket (res->ai_family, res->ai_socktype, 157+ if ((newsocket = socket (res->ai_family, res->ai_socktype,
158+ res->ai_protocol)) < 0) 158+ res->ai_protocol)) < 0)
159+ return -1; 159+ return -1;
160+ 160+
161+ if (ioctl (newsocket, FIONBIO, (char *)&_true) < 0) 161+ if (ioctl (newsocket, FIONBIO, (char *)&_true) < 0)
162 goto ErrorReturn; 162 goto ErrorReturn;
163  163
164- address.sin_family = AF_INET; 164- address.sin_family = AF_INET;
165- address.sin_addr.s_addr = INADDR_ANY; 165- address.sin_addr.s_addr = INADDR_ANY;
166- address.sin_port = htons(port); 166- address.sin_port = htons(port);
167- if( bind (newsocket, (void *)&address, sizeof(address)) == -1) 167- if( bind (newsocket, (void *)&address, sizeof(address)) == -1)
168+#ifdef IPV6_BINDV6ONLY 168+#ifdef IPV6_BINDV6ONLY
169+ if (setsockopt(newsocket, IPPROTO_IPV6, IPV6_BINDV6ONLY, &false, 169+ if (setsockopt(newsocket, IPPROTO_IPV6, IPV6_BINDV6ONLY, &wrong,
170+ sizeof(false)) < 0) { 170+ sizeof(wrong)) < 0) {
171+ /* I don't care */ 171+ /* I don't care */
172+ } 172+ }
173+#endif 173+#endif
174+ 174+
175+ if (bind (newsocket, res->ai_addr, res->ai_addrlen) < 0) 175+ if (bind (newsocket, res->ai_addr, res->ai_addrlen) < 0)
176 goto ErrorReturn; 176 goto ErrorReturn;
177  177
178+ freeaddrinfo(res); 178+ freeaddrinfo(res);
179 return newsocket; 179 return newsocket;
180  180
181 ErrorReturn: 181 ErrorReturn:
182+ if (res) 182+ if (res)
183+ freeaddrinfo(res); 183+ freeaddrinfo(res);