Skip to content

Commit

Permalink
Exclude shared ethernet connections from switching (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir authored Jan 24, 2025
1 parent ea5294f commit 237675e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-nm-helper (1.35.0) stable; urgency=medium

* Exclude shared ethernet connections from switching

-- Nikolay Korotkiy <[email protected]> Wed, 22 Jan 2025 17:30:00 +0400

wb-nm-helper (1.34.9) stable; urgency=medium

* Fix removing dns settings
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: wb-nm-helper
Section: admin
Priority: optional
Maintainer: Petr Krasnoshchekov <petr.krasnoshchekov@wirenboard.ru>
Maintainer: Wiren Board team <info@wirenboard.com>
Build-Depends: debhelper (>= 10),
dh-python,
python3-all,
Expand Down
3 changes: 3 additions & 0 deletions wb/nm_helper/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def get_default_tiers(self) -> List[ConnectionTier]:
continue
tiers[1].connections.append(connection_id)
elif device_type == NM_DEVICE_TYPE_ETHERNET:
if item.get_settings().get("ipv4", {}).get("method") == "shared":
logging.debug("Skipping shared connection %s", connection_id)
continue
tiers[0].connections.append(connection_id)
else:
logging.warning("Unknown connection type: %s", connection_type)
Expand Down
2 changes: 2 additions & 0 deletions wb/nm_helper/virtual_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ def _has_permanent_connectivity(self, active_connection_path: str) -> bool:
return True
if settings.get("802-11-wireless", {}).get("mode") == "ap":
return True
if settings.get("ipv4", {}).get("method") == "shared":
return True
return settings.get("user", {}).get("data", {}).get("wb.read-only", "false") == "true"
except dbus.exceptions.DBusException as ex:
logging.debug("Can't define if connection has permanent connectivity: %s", ex)
Expand Down

0 comments on commit 237675e

Please sign in to comment.