miniupnpd: change "allow_thirdparty" PCP option to a bit flag

This commit is contained in:
Thomas Bernard 2014-05-06 13:15:24 +02:00
parent c801138c63
commit 0e49fe7e94
3 changed files with 5 additions and 3 deletions

View File

@ -996,7 +996,8 @@ init(int argc, char * * argv, struct runtime_vars * v)
}
break;
case UPNPPCPALLOWTHIRDPARTY:
allow_thirdparty = true;
if(strcmp(ary_options[i].value, "yes") == 0)
SETFLAG(PCP_ALLOWTHIRDPARTYMASK);
break;
#endif
#ifdef PF_ENABLE_FILTER_RULES

View File

@ -34,7 +34,6 @@ time_t startup_time = 0;
/* for PCP */
unsigned long int min_lifetime = 120;
unsigned long int max_lifetime = 86400;
int allow_thirdparty = 0;
#endif
int runtime_flags = 0;

View File

@ -34,7 +34,6 @@ extern time_t startup_time;
extern unsigned long int min_lifetime;
extern unsigned long int max_lifetime;
extern int allow_thirdparty;
/* runtime boolean flags */
extern int runtime_flags;
@ -58,6 +57,9 @@ extern int runtime_flags;
#define IPV6FCFWDISABLEDMASK 0x0100
#define IPV6FCINBOUNDDISALLOWEDMASK 0x0200
#endif
#ifdef ENABLE_PCP
#define PCP_ALLOWTHIRDPARTYMASK 0x0400
#endif
#define SETFLAG(mask) runtime_flags |= mask
#define GETFLAG(mask) (runtime_flags & mask)