mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
verify that ext addr is not 0
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1908 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c182f0c27d
commit
7efc0ef9b7
@ -2450,6 +2450,15 @@ bool p3ConnectMgr::setExtAddress(std::string id, struct sockaddr_in addr)
|
||||
ownState.currentserveraddr.sin_port != addr.sin_port) {
|
||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||
ownState.currentserveraddr = addr;
|
||||
//check port and address
|
||||
if (ownState.currentserveraddr.sin_addr.s_addr == 0) {
|
||||
//use internal port for now
|
||||
ownState.currentserveraddr.sin_addr = ownState.currentlocaladdr.sin_addr;
|
||||
}
|
||||
if (addr.sin_port == 0) {
|
||||
//use internal port for now
|
||||
ownState.currentserveraddr.sin_port = ownState.currentlocaladdr.sin_port;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user