From d3db68cb00d47dd0b4e8b59024beb4a2d5e115ca Mon Sep 17 00:00:00 2001 From: Geaaru Date: Thu, 11 Oct 2018 13:57:29 +0200 Subject: [PATCH] server_async: Permit to configure reuse_address/port --- pyrad/server_async.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)