From 4447777c581dbf3d9f5fa8f0df2dff00e7b89ed9 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 13 Jan 2022 00:05:04 +0000 Subject: [PATCH] stun on send too --- hblink.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index f7c3585..24ac400 100755 --- a/hblink.py +++ b/hblink.py @@ -130,7 +130,11 @@ class OPENBRIDGE(DatagramProtocol): def dereg(self): logger.info('(%s) is mode OPENBRIDGE. No De-Registration required, continuing shutdown', self._system) - def send_system(self, _packet): + def send_system(self, _packet): + #Don't do anything if we are STUNned + if 'STUN' in self._CONFIG: + logger.info('(%s) Bridge STUNned, discarding', self._system) + return if _packet[:4] == DMRD and self._config['TARGET_IP']: #_packet = _packet[:11] + self._config['NETWORK_ID'] + _packet[15:] _packet = b''.join([_packet[:11], self._CONFIG['GLOBAL']['SERVER_ID'], _packet[15:]])