igmpproxy: allow 0.0.0.0/0 as allowed net in the config

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@40729 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2014-05-08 13:10:38 +00:00
parent 3cc7097976
commit 10c5647407

View File

@ -0,0 +1,24 @@
--- 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;
}