summaryrefslogtreecommitdiff
path: root/src/op_mode/connect_disconnect.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-02-08 11:00:04 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-02-09 08:32:21 +0000
commitffc6dc28780f4d3e8c548f3709c7f3d17babda68 (patch)
tree215a6b3b03e576bf8847665e145ea5d62bee61de /src/op_mode/connect_disconnect.py
parent98c6434e7433e6a0aa1034b39c9130d390bbe591 (diff)
downloadvyos-1x-ffc6dc28780f4d3e8c548f3709c7f3d17babda68.tar.gz
vyos-1x-ffc6dc28780f4d3e8c548f3709c7f3d17babda68.zip
T5703: Fix reapply QoS for connection-oriented interfaces
After `disconnect` and `connect` connection-oriented interfaces like PPPoE, QoS policy has to be reapplied
Diffstat (limited to 'src/op_mode/connect_disconnect.py')
-rwxr-xr-xsrc/op_mode/connect_disconnect.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/op_mode/connect_disconnect.py b/src/op_mode/connect_disconnect.py
index 10034e499..bd02dc6ea 100755
--- a/src/op_mode/connect_disconnect.py
+++ b/src/op_mode/connect_disconnect.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020-2023 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -19,6 +19,7 @@ import argparse
from psutil import process_iter
+from vyos.configquery import ConfigTreeQuery
from vyos.utils.process import call
from vyos.utils.commit import commit_in_progress
from vyos.utils.network import is_wwan_connected
@@ -59,6 +60,17 @@ def connect(interface):
else:
print(f'Unknown interface {interface}, can not connect. Aborting!')
+ # Reaply QoS configuration
+ config = ConfigTreeQuery()
+ if config.exists(f'qos interface {interface}'):
+ count = 1
+ while commit_in_progress():
+ if ( count % 60 == 0 ):
+ print(f'Commit still in progress after {count}s - waiting')
+ count += 1
+ time.sleep(1)
+ call('/usr/libexec/vyos/conf_mode/qos.py')
+
def disconnect(interface):
""" Disconnect dialer interface """