openbsd-ports/games/openarena/patches/patch-code_qcommon_net_ip_c
weerd a744348a5c OpenArena is an open-source content package for Quake III Arena licensed
under the GPL, effectively creating a free stand-alone game. You do not
need Quake III Arena to play this game.

Not connected to builds yet. Discussed with jasper@, robert@ and
sthen@.
2008-10-27 13:29:02 +00:00

26 lines
867 B
Plaintext

$OpenBSD: patch-code_qcommon_net_ip_c,v 1.1.1.1 2008/10/27 13:29:02 weerd Exp $
--- code/qcommon/net_ip.c.orig Sun Aug 31 14:36:07 2008
+++ code/qcommon/net_ip.c Sun Aug 31 14:44:25 2008
@@ -335,7 +335,21 @@ Sys_SockaddrToString
*/
static void Sys_SockaddrToString(char *dest, int destlen, struct sockaddr *input, int inputlen)
{
+/* OA's inputlen is incompatible with getnameinfo() on OpenBSD */
+#ifdef __OpenBSD__
+ struct sockaddr_in *s4;
+ struct sockaddr_in6 *s6;
+
+ if (input->sa_family == AF_INET) {
+ s4 = (struct sockaddr_in *)(input);
+ inet_ntop(AF_INET, (void *)&(s4->sin_addr), dest, destlen);
+ } else if (input->sa_family == AF_INET6) {
+ s6 = (struct sockaddr_in6 *)(input);
+ inet_ntop(AF_INET6, (void *)&(s6->sin6_addr), dest, destlen);
+ }
+#else
getnameinfo(input, inputlen, dest, destlen, NULL, 0, NI_NUMERICHOST);
+#endif
}
/*