pop-os / system76-driver

System76 Driver for Pop!_OS
Other
112 stars 29 forks source link

system76-nm-restart restart NetworkManager causing inconsistent vpn interface state #298

Open cavedon opened 3 months ago

cavedon commented 3 months ago

Distribution (run cat /etc/os-release):

 PRETTY_NAME="Ubuntu 22.04.4 LTS"

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

system76-driver:
  Installed: 20.04.92~1719871568~22.04~efacd2f~dev
  Candidate: 20.04.92~1719871568~22.04~efacd2f~dev
  Version table:
 *** 20.04.92~1719871568~22.04~efacd2f~dev 1001
       1001 http://ppa.launchpad.net/system76-dev/stable/ubuntu jammy/main amd64 Packages
       1001 http://ppa.launchpad.net/system76-dev/stable/ubuntu jammy/main i386 Packages
        100 /var/lib/dpkg/status

Issue/Bug Description: Upon resume from sleep, /lib/systemd/system-sleep/system76-nm-restart will restart NetworkManger, causing some interfaces to be left in an inconsistent state.

Steps to reproduce (if you know):

  1. Connect to a VPN using NetworkManager and openconnect.
  2. Send to system to sleep
  3. Resume from sleep
  4. The VPN will be disconnected, but the vpn0 interface will still be up with the old IP address assigned
  5. Connect to the VPN again
  6. Now the vpn0 interface will have two IP addresses and routing will be broken

The issue is caused by restarting NetworkManger while it is recovering from a sleep status.

Expected behavior: Do not restart NetworkManager.