Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit b58214d

Browse files
committed
NM: Set WireGuard MTU if available
1 parent 5f098e3 commit b58214d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

eduvpn/nm.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,14 @@ def start_wireguard_connection( # noqa: C901
545545
private_key = config["Interface"]["PrivateKey"]
546546
w_con.set_property(NM.SETTING_WIREGUARD_PRIVATE_KEY, private_key)
547547

548+
# set MTU if available in the config
549+
mtu = config["Interface"].get("MTU")
550+
if mtu:
551+
try:
552+
w_con.set_property(NM.SETTING_WIREGUARD_MTU, int(mtu))
553+
except ValueError:
554+
_logger.warning(f"got invalid WireGuard MTU value: {mtu}")
555+
548556
profile.add_setting(s_ip4)
549557
profile.add_setting(s_ip6)
550558
profile.add_setting(s_con)

0 commit comments

Comments
 (0)