miniupnpd: change "allow_thirdparty" PCP option to a bit flag
This commit is contained in:
parent
c801138c63
commit
0e49fe7e94
|
@ -996,7 +996,8 @@ init(int argc, char * * argv, struct runtime_vars * v)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UPNPPCPALLOWTHIRDPARTY:
|
case UPNPPCPALLOWTHIRDPARTY:
|
||||||
allow_thirdparty = true;
|
if(strcmp(ary_options[i].value, "yes") == 0)
|
||||||
|
SETFLAG(PCP_ALLOWTHIRDPARTYMASK);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef PF_ENABLE_FILTER_RULES
|
#ifdef PF_ENABLE_FILTER_RULES
|
||||||
|
|
|
@ -34,7 +34,6 @@ time_t startup_time = 0;
|
||||||
/* for PCP */
|
/* for PCP */
|
||||||
unsigned long int min_lifetime = 120;
|
unsigned long int min_lifetime = 120;
|
||||||
unsigned long int max_lifetime = 86400;
|
unsigned long int max_lifetime = 86400;
|
||||||
int allow_thirdparty = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int runtime_flags = 0;
|
int runtime_flags = 0;
|
||||||
|
|
|
@ -34,7 +34,6 @@ extern time_t startup_time;
|
||||||
|
|
||||||
extern unsigned long int min_lifetime;
|
extern unsigned long int min_lifetime;
|
||||||
extern unsigned long int max_lifetime;
|
extern unsigned long int max_lifetime;
|
||||||
extern int allow_thirdparty;
|
|
||||||
|
|
||||||
/* runtime boolean flags */
|
/* runtime boolean flags */
|
||||||
extern int runtime_flags;
|
extern int runtime_flags;
|
||||||
|
@ -58,6 +57,9 @@ extern int runtime_flags;
|
||||||
#define IPV6FCFWDISABLEDMASK 0x0100
|
#define IPV6FCFWDISABLEDMASK 0x0100
|
||||||
#define IPV6FCINBOUNDDISALLOWEDMASK 0x0200
|
#define IPV6FCINBOUNDDISALLOWEDMASK 0x0200
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_PCP
|
||||||
|
#define PCP_ALLOWTHIRDPARTYMASK 0x0400
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SETFLAG(mask) runtime_flags |= mask
|
#define SETFLAG(mask) runtime_flags |= mask
|
||||||
#define GETFLAG(mask) (runtime_flags & mask)
|
#define GETFLAG(mask) (runtime_flags & mask)
|
||||||
|
|
Loading…
Reference in New Issue