Merge branch 'tinyproxy:master' into mm-rdns

This commit is contained in:
huaraz 2021-08-31 20:36:40 +01:00 committed by GitHub
commit a1bba96ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,15 @@ static int dotted_mask(char *bitmask_string, unsigned char array[])
return 0; return 0;
} }
static int dotted_mask(char *bitmask_string, unsigned char array[])
{
unsigned char v4bits[4];
if (1 != inet_pton (AF_INET, bitmask_string, v4bits)) return -1;
memset (array, 0xff, IPV6_LEN-4);
memcpy (array + IPV6_LEN-4, v4bits, 4);
return 0;
}
/* /*
* Fills in the netmask array given a numeric value. * Fills in the netmask array given a numeric value.
* *