mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
wireguard: Stop using some libnm deprecated API
- This is improved reliability of adding a new client. Tests: - Auto adding and removing a client works. Console messages do not warn about deprecated commit_changes() API anymore. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
50b77c5d73
commit
63ca0eadff
1 file changed
+2
-2
@@ -355,7 +355,7 @@ def add_client(public_key):
|
||||
peer.set_persistent_keepalive(25) # To keep NAT 'connections' alive
|
||||
peer.append_allowed_ip(_get_next_available_ip_address(settings), False)
|
||||
settings.append_peer(peer)
|
||||
connection.commit_changes(True)
|
||||
connection.commit_changes_async(True)
|
||||
network.reactivate_connection(connection.get_uuid())
|
||||
|
||||
# Wait upto 10 seconds for client to appear
|
||||
@@ -386,7 +386,7 @@ def remove_client(public_key):
|
||||
raise KeyError('Client not found')
|
||||
|
||||
settings.remove_peer(peer_index)
|
||||
connection.commit_changes(True)
|
||||
connection.commit_changes_async(True)
|
||||
network.reactivate_connection(connection.get_uuid())
|
||||
|
||||
# Wait upto 10 seconds for client to disappear
|
||||
|
||||
Reference in new issue
Block a user