diff --git a/samples/UDPConsole.py b/samples/UDPConsole.py index ee2f183b..5951b886 100755 --- a/samples/UDPConsole.py +++ b/samples/UDPConsole.py @@ -126,10 +126,17 @@ def indication(self, pdu): # check the address if addr == "*": + if not local_broadcast_tuple: + sys.stderr.write("err: no local broadcast\n") + return + dest = local_broadcast_tuple elif ':' in addr: addr, port = addr.split(':') if addr == "*": + if not local_broadcast_tuple: + sys.stderr.write("err: no local broadcast\n") + return dest = (local_broadcast_tuple[0], int(port)) else: dest = (addr, int(port)) @@ -234,6 +241,9 @@ def main(): if args.noBroadcast: _log.debug(" - skipping broadcast") + elif not local_broadcast_tuple: + _log.debug(" - no local broadcast") + elif local_unicast_tuple == local_broadcast_tuple: _log.debug(" - identical unicast and broadcast tuples")