After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740739 - cannot activate shared connection on physically disconnected ethernet
cannot activate shared connection on physically disconnected ethernet
Status: RESOLVED OBSOLETE
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Beniamino Galvani
NetworkManager maintainer(s)
Depends on:
Blocks: nm-next
 
 
Reported: 2014-11-26 10:23 UTC by Pavel Simerda
Modified: 2020-11-12 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] device: don't deactivate shared connection on link down (1.61 KB, patch)
2016-02-17 10:27 UTC, Beniamino Galvani
none Details | Review

Description Pavel Simerda 2014-11-26 10:23:46 UTC
Use case:

Connect two computers using an ethernet cable so that one shares internet with the other.

Expected behavior:

Connection sharing means using the computer as a router, so I would expect that I could activate this type of connection at any time, even when there's no cable connected or when the other computer is off.

Actual behavior:

It's not possible to activate the connection (at least via nm-applet) when the other computer is off.

Rationale:

Whether I want to share a connection, or, say, apply a manual configuration, shouldn't depend on the link state as NM has no clue on how I will use the connection. One possibility is to actually *boot* the other computer using network. This may not even be PXE from the other computer that would need additional configuration, it can be a HTTP based boot for example.

Notes:

I would even say that for manual and shared connections, it would be best to ignore carrier either always or at least by default. To state it more precisely, I would say that a connection that doesn't need to listen on the network to perform configuration (like DHCP or rdisc client) should ignore the carrier so that:

1) It can be started at any time and is thus presented to the user.

2) It doesn't drop when a cable is unplugged or the directly connected machine or switch gets rebooted.

I originally wanted to file this with nm-applet but now I'm not sure whether the issue is specific to nm-applet or intrinsic to NetworkManager.
Comment 1 Pavel Simerda 2014-12-23 19:11:59 UTC
I would like to get the issue considered for 1.2. A solution would probably require that some connections (those that need to talk over the device as part of the connection procecure) are not applied until the device is physically connected, while other connections (those that don't need that) are applied immediately. DAD might be a bit tricky, though. The user would then see all connections that can be applied in the current device state.
Comment 2 Dan Williams 2016-02-16 16:38:15 UTC
Yeah, carrier should be ignored on shared connections, like we ignore the fact that the access point doesn't exist yet for WiFi AP/Hotspot.
Comment 3 Thomas Haller 2016-02-16 17:48:43 UTC
(This might be already fixed. Needs testing first...)
Comment 4 Beniamino Galvani 2016-02-17 09:33:35 UTC
Now a connection with ipv4.method=shared can be activated manually
even if the carrier is off. But still the connection will drop when
the carrier goes down; probably we only need to ignore down events
when the IPv4 method is 'shared'.

Also, the device doesn't auto-activate when the carrier is off (unless
the device has ignore-carrier set), but I don't think this is a
problem since it will eventually activate when the link goes up and
then stay up.
Comment 5 Beniamino Galvani 2016-02-17 10:27:05 UTC
Created attachment 321472 [details] [review]
[PATCH] device: don't deactivate shared connection on link down
Comment 6 Thomas Haller 2016-02-17 11:06:22 UTC
There is already a function connection_requires_carrier(). Maybe that should be reused?
Comment 7 Beniamino Galvani 2016-02-17 13:10:39 UTC
(In reply to Thomas Haller from comment #6)
> There is already a function connection_requires_carrier(). Maybe that should
> be reused?

Ok, but connection_requires_carrier() returns FALSE also for
ipv4.method=manual and this means that when the carrier goes down, a
device with static addresses would remain activated and NM global
state "connected/full" even when there is no connectivity.

Probably we should limit this behavior to shared connections, what do
you think?
Comment 8 Thomas Haller 2016-02-17 13:40:23 UTC
Pavel said:

> I would even say that for manual and shared connections, it would be best to
> ignore carrier either always or at least by default. To state it more 
> precisely, I would say that a connection that doesn't need to listen on the 
> network to perform configuration (like DHCP or rdisc client) should ignore the 
> carrier so that:


I think in the future we wont less of one either-or "method", but more like: turning on different addressing modes.
Like:

   [ ] DHCPv4/auto
   [ ] manual addresses
   [ ] link-local
   [ ] shared (shared is incompatible with auto).

In such a scenario it's much less clear when the user wants to ignore carrier and when not.

Eventually, I think that the connection should have a property "ignore-carrier".




But really, connection_requires_carrier() allows you to activate a connection without carrier. There you have the same problem, e.g. with connected/full state. Why would that behave differently when carrier is lost?





In any case, I would still reuse connection_requires_carrier(), possibly with a new argument:

static gboolean
connection_requires_carrier (NMConnection *connection, gboolean on_carrier_lost)

That way, the logic is still in one place and you can grep for connection_requires_carrier to find all the places which ask this question.
Comment 9 André Klapper 2020-11-12 14:26:34 UTC
bugzilla.gnome.org is being shut down in favor of a GitLab instance. 
We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).