From 4e938ade20c8e1753ba7a1be6bd54bb22df5e84b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 8 May 2014 13:10:38 +0000 Subject: [PATCH] igmpproxy: allow 0.0.0.0/0 as allowed net in the config Signed-off-by: Felix Fietkau SVN-Revision: 40729 --- .../patches/200-allow_wildcard_addr.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 net/igmpproxy/patches/200-allow_wildcard_addr.patch diff --git a/net/igmpproxy/patches/200-allow_wildcard_addr.patch b/net/igmpproxy/patches/200-allow_wildcard_addr.patch new file mode 100644 index 000000000..0dd772007 --- /dev/null +++ b/net/igmpproxy/patches/200-allow_wildcard_addr.patch @@ -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; + } -- 2.30.2