Skip to content

Commit

Permalink
upnpdescgen.c: rootDesc.xml skip DeviceProtection and WANIPv6Firewall…
Browse files Browse the repository at this point in the history
…Control when force_igd1

see #539
  • Loading branch information
miniupnp committed Aug 11, 2021
1 parent 182f0a0 commit 37104e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions miniupnpd/upnpdescgen.c
Expand Up @@ -943,6 +943,7 @@ genXML(char * str, int * len, int * tmplen,
str = strcat_str(str, len, tmplen, eltname);
str = strcat_char(str, len, tmplen, '>');
}
unstack:
for(;;)
{
if(top < 0)
Expand All @@ -968,6 +969,14 @@ genXML(char * str, int * len, int * tmplen,
else
{
unsigned long k = (unsigned long)p[i].data;
#ifdef IGD_V2
if((force_igd1 && (p[k & 0xffff].eltname[0] == '/')) &&
(strcmp(p[k & 0xffff].data, "urn:schemas-upnp-org:service:DeviceProtection:1") == 0 ||
strcmp(p[k & 0xffff].data, "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1") == 0)) {
/* Skip the child element */
goto unstack;
}
#endif
/* node with child(ren) */
/*printf("<%s>\n", eltname); */
str = strcat_char(str, len, tmplen, '<');
Expand Down

0 comments on commit 37104e5

Please sign in to comment.