Checking lan only in non-thirdparty mode.

This commit is contained in:
Markus Stenberg 2014-05-13 13:27:27 +03:00 committed by Thomas Bernard
parent 28b3afbb8f
commit 924b6d1613
1 changed files with 9 additions and 5 deletions

View File

@ -1568,11 +1568,15 @@ int ProcessIncomingPCPPacket(int s, unsigned char *buff, int len,
return 0; return 0;
} }
lan_addr = get_lan_for_peer(senderaddr); /* If we're in allow third party-mode, we probably don't care
if(lan_addr == NULL) { * about locality either. Let's hope firewall is ok. */
syslog(LOG_WARNING, "PCP packet sender %s not from a LAN, ignoring", if (!GETFLAG(PCP_ALLOWTHIRDPARTYMASK)) {
addr_str); lan_addr = get_lan_for_peer(senderaddr);
return 0; 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) ) { if (processPCPRequest(buff, len, &pcp_msg_info) ) {