Tidy up sockaddr update from keepalives

This commit is contained in:
Simon 2021-04-10 01:13:00 +01:00
parent 1bd776dfd9
commit 919b7842da
1 changed files with 4 additions and 3 deletions

View File

@ -218,9 +218,10 @@ class OPENBRIDGE(DatagramProtocol):
self._config['_bcka'] = time()
if _sockaddr != self._config['TARGET_SOCK']:
h,p = _sockaddr
if h != self._config['TARGET_IP']:
self._config['TARGET_IP'] = h
logger.info('(%s) *BridgeControl* Source IP has changed for OBP, updating',self._system)
logger.info('(%s) *BridgeControl* Source IP and Port has changed for OBP from %s:%s to %s:%s, updating',self._system,self._config['TARGET_IP'],self._config['TARGET_port'],h,p)
self._config['TARGET_IP'] = h
self._config['TARGET_PORT'] = p
self._config['TARGET_SOCK'] = (h,p)
else:
h,p = _sockaddr