|
@@ -84,7 +84,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
|
|
|
ip->len = 4;
|
|
|
|
|
|
if (str2int(&token->val, &v) < 0) goto err;
|
|
|
- if (v < 0 || v > 255) goto err;
|
|
|
+ if (v > 255) goto err;
|
|
|
|
|
|
ip->u.addr[0] = v;
|
|
|
|
|
@@ -97,7 +97,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
|
|
|
if (ret < 0) return -1;
|
|
|
if (ret > 0 || t.type != CFG_TOKEN_ALPHA) goto err;
|
|
|
if (str2int(&t.val, &v) < 0) goto err;
|
|
|
- if (v < 0 || v > 255) goto err;
|
|
|
+ if (v > 255) goto err;
|
|
|
ip->u.addr[i] = v;
|
|
|
}
|
|
|
|