You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
696 B
25 lines
696 B
11 years ago
|
--- a/src/config.c
|
||
|
+++ b/src/config.c
|
||
|
@@ -357,15 +357,18 @@ struct SubnetList *parseSubnetAddress(ch
|
||
|
tmpStr = strtok(NULL, "/");
|
||
|
if(tmpStr != NULL) {
|
||
|
int bitcnt = atoi(tmpStr);
|
||
|
- if(bitcnt <= 0 || bitcnt > 32) {
|
||
|
+ if(bitcnt < 0 || bitcnt > 32) {
|
||
|
my_log(LOG_WARNING, 0, "The bits part of the address is invalid : %d.",tmpStr);
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
- mask <<= (32 - bitcnt);
|
||
|
+ if (bitcnt == 0)
|
||
|
+ mask = 0;
|
||
|
+ else
|
||
|
+ mask <<= (32 - bitcnt);
|
||
|
}
|
||
|
|
||
|
- if(addr == -1 || addr == 0) {
|
||
|
+ if(addr == -1) {
|
||
|
my_log(LOG_WARNING, 0, "Unable to parse address token '%s'.", addrstr);
|
||
|
return NULL;
|
||
|
}
|