pkgsrc/games/quake6/patches/patch-ag

22 lines
721 B
Text

$NetBSD: patch-ag,v 1.1 2002/01/10 16:43:28 skrll Exp $
--- qw_client/cl_main.c.orig Mon Jan 10 16:59:34 2000
+++ qw_client/cl_main.c
@@ -854,9 +854,14 @@
Con_Printf ("client command\n");
- if ((*(unsigned *)net_from.ip != *(unsigned *)net_local_adr.ip
- && *(unsigned *)net_from.ip != htonl(INADDR_LOOPBACK)) )
- {
+ if (memcmp(net_from.ip, net_local_adr.ip, sizeof(net_from.ip)) == 0)
+ ;
+ else if (IN6_IS_ADDR_LOOPBACK((struct in6_addr *)net_from.ip))
+ ;
+ else if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)net_from.ip) &&
+ ((struct in_addr *)&net_from.ip[3])->s_addr == htonl(INADDR_LOOPBACK))
+ ;
+ else {
Con_Printf ("Command packet from remote host. Ignored.\n");
return;
}