X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsubnet.c;h=446d38b15f4c86ec34a583b5126705419616bcdf;hb=551cd19406a560d0d206bff5b4e9da064ec222b6;hp=d820227b1ed686ae703bcdb053a1e654441a53c2;hpb=636200d1a2024982fe5b3062153daa72a8253015;p=tinc diff --git a/src/subnet.c b/src/subnet.c index d820227b..446d38b1 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -219,9 +219,6 @@ bool str2net(subnet_t *subnet, const char *subnetstr) } if(sscanf(subnetstr, "%hu.%hu.%hu.%hu", &x[0], &x[1], &x[2], &x[3]) == 4) { - if(l < 0 || l > 32) - return false; - subnet->type = SUBNET_IPV4; subnet->net.ipv4.prefixlength = 32; @@ -236,9 +233,6 @@ bool str2net(subnet_t *subnet, const char *subnetstr) if(sscanf(subnetstr, "%hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx", &x[0], &x[1], &x[2], &x[3], &x[4], &x[5], &x[6], &x[7]) == 8) { - if(l < 0 || l > 128) - return false; - subnet->type = SUBNET_IPV6; subnet->net.ipv6.prefixlength = 128;