keep ipv6 out from the loop
authorPierre Habouzit <madcoder@debian.org>
Sun, 19 Oct 2008 14:42:18 +0000 (16:42 +0200)
committerPierre Habouzit <madcoder@debian.org>
Sun, 19 Oct 2008 14:42:18 +0000 (16:42 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
postlicyd/iplist.c

index 2aa757f..cddc70a 100644 (file)
@@ -456,6 +456,10 @@ static filter_result_t iplist_filter(const filter_t *filter, const query_t *quer
     bool  error = true;
 
     if (parse_ipv4(query->client_address, &end, &ip) != 0) {
+        if (strchr(query->client_address, ':')) {
+            /* iplist only works on IPv4 */
+            return HTK_FAIL;
+        }
         warn("invalid client address: %s, expected ipv4",
              query->client_address);
         return HTK_ERROR;