Skip to content

Commit

Permalink
Only deal with --listen if there are arguments to be dealt with.
Browse files Browse the repository at this point in the history
  • Loading branch information
alsmith committed May 2, 2022
1 parent 2ebb291 commit 2c0e4c7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions multicast-relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,16 @@ def __init__(self, interfaces, noTransmitInterfaces, ifFilter, waitForIP, ttl,
self.bindings = set()

self.listenAddr = []
for addr in listen:
components = addr.split('/')
if len(components) == 1:
components.append('32')
if not components[1].isdigit():
raise ValueError('--listen netmask is not an integer')
if int(components[1]) not in range(0, 33):
raise ValueError('--listen netmask specifies an invalid netmask')
self.listenAddr.append(components)
if listen:
for addr in listen:
components = addr.split('/')
if len(components) == 1:
components.append('32')
if not components[1].isdigit():
raise ValueError('--listen netmask is not an integer')
if int(components[1]) not in range(0, 33):
raise ValueError('--listen netmask specifies an invalid netmask')
self.listenAddr.append(components)

self.listenSock = None
if remote:
Expand Down

0 comments on commit 2c0e4c7

Please sign in to comment.