Shared network subnet clashes with default route
Summary: shared network functionality does not check if its preferred subnet (10.42.0.0/24) is already connected. This can lead to the same subnet on 2 unrelated NICs.
Steps to reproduce:
- Connect 2 NM-equipped devices with 2+ NICs together (here laptop with Internet connection and the Librem 5 connected over USB networking).
- Share network from one to the other (here Plasma tools used to share laptop's connection to the phone, phone picks up 10.42.0.5/24).
- Share network on the other device (here GNOME settings used to share phone's connection as a WiFi hotspot).
Actual results: The phone selects 10.42.0.1/24 (same subnet!) as the new network, and now has the same network on 2 NICs, loses connectivity to the default route (10.42.0.1/24 was the laptop's address too).
Expected results: The phone selects a different subnet if 10.42.0.0/24 is already routed. This might be insufficient if the phone-laptop connection appears as the second step, but a restart of the hotspot would still fix it.