Re: [PATCH net-next v25 04/23] ovpn: keep carrier always on for MP interfaces

From: Antonio Quartulli
Date: Fri Apr 11 2025 - 04:40:01 EST


On 11/04/2025 05:03, Jakub Kicinski wrote:
On Mon, 07 Apr 2025 21:46:12 +0200 Antonio Quartulli wrote:
+ /* carrier for P2P interfaces is switched on and off when
+ * the peer is added or deleted.
+ *
+ * in case of P2MP interfaces we just keep the carrier always on
+ */
+ if (ovpn->mode == OVPN_MODE_MP)
+ netif_carrier_on(dev);

Any reason why you turn it during open rather than leaving it be before
registration? Now the link is down until first open, then it stays up
even if user closes?

Mh your concern makes sense.
Originally Andrew suggested adding the carrier_on() to _probe(), which I interpreted as _open() (I don't think virtual drivers have any _probe() hook).

Being the goal to keep the carrier always on for MP ifaces, I'd say I should move the carrier_on() call to newlink().
There I can set the carrier on if MP or off if P2P.

Regards,

--
Antonio Quartulli
OpenVPN Inc.