igmpproxy: allow 0.0.0.0/0 as allowed net in the config
authorFelix Fietkau <nbd@openwrt.org>
Thu, 8 May 2014 13:10:38 +0000 (13:10 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 8 May 2014 13:10:38 +0000 (13:10 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40729

net/igmpproxy/patches/200-allow_wildcard_addr.patch [new file with mode: 0644]

diff --git a/net/igmpproxy/patches/200-allow_wildcard_addr.patch b/net/igmpproxy/patches/200-allow_wildcard_addr.patch
new file mode 100644 (file)
index 0000000..0dd7720
--- /dev/null
@@ -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;
+     }