diff --git a/pyrad/server_async.py b/pyrad/server_async.py index 3619f7f..a054750 100644 --- a/pyrad/server_async.py +++ b/pyrad/server_async.py @@ -287,7 +287,8 @@ def CreateReplyPacket(pkt, **attributes): async def initialize_transports(self, enable_acct=False, enable_auth=False, enable_coa=False, - addresses=None): + addresses=None, reuse_address=True, + reuse_port=True): task_list = [] @@ -312,7 +313,7 @@ async def initialize_transports(self, enable_acct=False, bind_addr = (addr, self.acct_port) acct_connect = self.loop.create_datagram_endpoint( protocol_acct, - reuse_address=True, reuse_port=True, + reuse_address=reuse_address, reuse_port=reuse_port, local_addr=bind_addr ) self.acct_protocols.append(protocol_acct) @@ -331,7 +332,7 @@ async def initialize_transports(self, enable_acct=False, auth_connect = self.loop.create_datagram_endpoint( protocol_auth, - reuse_address=True, reuse_port=True, + reuse_address=reuse_address, reuse_port=reuse_port, local_addr=bind_addr ) self.auth_protocols.append(protocol_auth) @@ -350,7 +351,7 @@ async def initialize_transports(self, enable_acct=False, coa_connect = self.loop.create_datagram_endpoint( protocol_coa, - reuse_address=True, reuse_port=True, + reuse_address=reuse_address, reuse_port=reuse_port, local_addr=bind_addr ) self.coa_protocols.append(protocol_coa)