From 924b6d16137ff5e915992ea681f80a9e0ad81ec6 Mon Sep 17 00:00:00 2001 From: Markus Stenberg Date: Tue, 13 May 2014 13:27:27 +0300 Subject: [PATCH] Checking lan only in non-thirdparty mode. --- miniupnpd/pcpserver.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/miniupnpd/pcpserver.c b/miniupnpd/pcpserver.c index 8db9cf7..f747d72 100644 --- a/miniupnpd/pcpserver.c +++ b/miniupnpd/pcpserver.c @@ -1568,11 +1568,15 @@ int ProcessIncomingPCPPacket(int s, unsigned char *buff, int len, return 0; } - lan_addr = get_lan_for_peer(senderaddr); - if(lan_addr == NULL) { - syslog(LOG_WARNING, "PCP packet sender %s not from a LAN, ignoring", - addr_str); - return 0; + /* If we're in allow third party-mode, we probably don't care + * about locality either. Let's hope firewall is ok. */ + if (!GETFLAG(PCP_ALLOWTHIRDPARTYMASK)) { + lan_addr = get_lan_for_peer(senderaddr); + if(lan_addr == NULL) { + syslog(LOG_WARNING, "PCP packet sender %s not from a LAN, ignoring", + addr_str); + return 0; + } } if (processPCPRequest(buff, len, &pcp_msg_info) ) {