From 8f4d39002ca7e5ce83b1126f896c675897dfd2e9 Mon Sep 17 00:00:00 2001 From: Adam Olsen Date: Mon, 17 Sep 2001 07:31:15 +0000 Subject: [PATCH] - add support for ipv4 embedded in ipv6 addresses. filtering should now be fully functional for ipv6. I really oughta test ipv6 sooner or later ;) --- qw/source/sv_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 88f49e8bf..d20ebdc9d 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -1198,7 +1198,7 @@ SV_StringToFilter (const char *address, ipfilter_t *f) byte b[4] = {}; #endif int mask = 0; - int i = 0; + int i; char *s; char *slash; char *c; @@ -1223,8 +1223,11 @@ SV_StringToFilter (const char *address, ipfilter_t *f) // parse the ip for ipv6 #ifdef HAVE_IPV6 if (inet_pton (AF_INET6, s, b) != 1) { - // FIXME: we *must* fill in the prefix bytes here if we're doing ipv6 -#error Prefix bytes not set for parsing ipv4 addresses + b[10] = 0xFF; // Prefix bytes for hosts that don't support ipv6 + b[11] = 0xFF; // (see RFC 2373, section 2.5.4) + i = 12; +#else + i = 0; #endif c = s;