tweak validate ID

identtg v1.3.6
Simon 4 years ago
parent 9310e4339c
commit b75a0b1989
No known key found for this signature in database
GPG Key ID: 6ACF11630B5D8F82

@ -450,7 +450,6 @@ class OPENBRIDGE(DatagramProtocol):
logger.warning('(%s) Packet more than 5s old!, discarding', self._system)
return
if self._CONFIG['GLOBAL']['VALIDATE_SERVER_IDS']:
#Discard bad source server
if ((len(str(int.from_bytes(_source_server,'big'))) < 4) or (len(str(int.from_bytes(_source_server,'big'))) > 7)):
if _stream_id not in self._laststrid:
@ -458,7 +457,7 @@ class OPENBRIDGE(DatagramProtocol):
self.send_bcsq(_dst_id,_stream_id)
self._laststrid.append(_stream_id)
return
elif (len(str(int.from_bytes(_source_server,'big'))) == 4 or (len(str(int.from_bytes(_source_server,'big'))) == 5)) and ((str(int.from_bytes(_source_server,'big'))[:4]) not in self._CONFIG['_SERVER_IDS'] ):
elif self._CONFIG['GLOBAL']['VALIDATE_SERVER_IDS'] and (len(str(int.from_bytes(_source_server,'big'))) == 4 or (len(str(int.from_bytes(_source_server,'big'))) == 5)) and ((str(int.from_bytes(_source_server,'big'))[:4]) not in self._CONFIG['_SERVER_IDS'] ):
if _stream_id not in self._laststrid:
logger.warning('(%s) Source Server ID is 4 or 5 digits but not in list: %s', self._system, int.from_bytes(_source_server,'big'))
self.send_bcsq(_dst_id,_stream_id)

Loading…
Cancel
Save

Powered by TurnKey Linux.