aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/igd_desc_parse.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-02 18:43:13 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-02 18:54:55 +0200
commit18281f4d205d9e320fad23ac3c28b66ea4bb2ff7 (patch)
treef007a38c98ad2f8d6e7b3cd85230b0ce4c5fcf02 /external/miniupnpc/igd_desc_parse.c
parentfixed unbound static lib on mingw as libunbound.dll.a (diff)
downloadmonero-18281f4d205d9e320fad23ac3c28b66ea4bb2ff7.tar.xz
remove dangling upnp port mappings, updated miniupnpc
Diffstat (limited to '')
-rw-r--r--[-rwxr-xr-x]external/miniupnpc/igd_desc_parse.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/external/miniupnpc/igd_desc_parse.c b/external/miniupnpc/igd_desc_parse.c
index 6c3e65677..0eaf21b6a 100755..100644
--- a/external/miniupnpc/igd_desc_parse.c
+++ b/external/miniupnpc/igd_desc_parse.c
@@ -1,8 +1,8 @@
-/* $Id: igd_desc_parse.c,v 1.14 2011/04/11 09:19:24 nanard Exp $ */
+/* $Id: igd_desc_parse.c,v 1.15 2014/07/01 13:01:17 nanard Exp $ */
/* Project : miniupnp
* http://miniupnp.free.fr/
* Author : Thomas Bernard
- * Copyright (c) 2005-2010 Thomas Bernard
+ * Copyright (c) 2005-2014 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */
@@ -26,6 +26,8 @@ void IGDstartelt(void * d, const char * name, int l)
}
}
+#define COMPARE(str, cstr) (0==memcmp(str, cstr, sizeof(cstr) - 1))
+
/* End element handler :
* update nesting level counter and update parser state if
* service element is parsed */
@@ -36,23 +38,16 @@ void IGDendelt(void * d, const char * name, int l)
/*printf("endelt %2d %.*s\n", datas->level, l, name);*/
if( (l==7) && !memcmp(name, "service", l) )
{
- /*
- if( datas->state < 1
- && !strcmp(datas->servicetype,
- // "urn:schemas-upnp-org:service:WANIPConnection:1") )
- "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"))
- datas->state ++;
- */
- if(0==strcmp(datas->tmp.servicetype,
- "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1")) {
+ if(COMPARE(datas->tmp.servicetype,
+ "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:")) {
memcpy(&datas->CIF, &datas->tmp, sizeof(struct IGDdatas_service));
- } else if(0==strcmp(datas->tmp.servicetype,
- "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1")) {
+ } else if(COMPARE(datas->tmp.servicetype,
+ "urn:schemas-upnp-org:service:WANIPv6FirewallControl:")) {
memcpy(&datas->IPv6FC, &datas->tmp, sizeof(struct IGDdatas_service));
- } else if(0==strcmp(datas->tmp.servicetype,
- "urn:schemas-upnp-org:service:WANIPConnection:1")
- || 0==strcmp(datas->tmp.servicetype,
- "urn:schemas-upnp-org:service:WANPPPConnection:1") ) {
+ } else if(COMPARE(datas->tmp.servicetype,
+ "urn:schemas-upnp-org:service:WANIPConnection:")
+ || COMPARE(datas->tmp.servicetype,
+ "urn:schemas-upnp-org:service:WANPPPConnection:") ) {
if(datas->first.servicetype[0] == '\0') {
memcpy(&datas->first, &datas->tmp, sizeof(struct IGDdatas_service));
} else {