From 0e49fe7e94b5ae33fcec44f00e396363dc5ae838 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 6 May 2014 13:15:24 +0200 Subject: [PATCH] miniupnpd: change "allow_thirdparty" PCP option to a bit flag --- miniupnpd/miniupnpd.c | 3 ++- miniupnpd/upnpglobalvars.c | 1 - miniupnpd/upnpglobalvars.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index e8dcf9d..4f56588 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -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 diff --git a/miniupnpd/upnpglobalvars.c b/miniupnpd/upnpglobalvars.c index 273e0c4..9750f04 100644 --- a/miniupnpd/upnpglobalvars.c +++ b/miniupnpd/upnpglobalvars.c @@ -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; diff --git a/miniupnpd/upnpglobalvars.h b/miniupnpd/upnpglobalvars.h index d9b761d..223f4da 100644 --- a/miniupnpd/upnpglobalvars.h +++ b/miniupnpd/upnpglobalvars.h @@ -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)