mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
ovpn: keep carrier always on for MP interfaces
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli <antonio@openvpn.net> Link: https://patch.msgid.link/20250415-b4-ovpn-v26-4-577f6097b964@openvpn.net Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
c2d950c467
commit
8327a3baa9
|
|
@ -93,10 +93,18 @@ static int ovpn_newlink(struct net_device *dev,
|
|||
ovpn->dev = dev;
|
||||
ovpn->mode = mode;
|
||||
|
||||
/* turn carrier explicitly off after registration, this way state is
|
||||
* clearly defined
|
||||
/* Set carrier explicitly after registration, this way state is
|
||||
* clearly defined.
|
||||
*
|
||||
* In case of MP interfaces we keep the carrier always on.
|
||||
*
|
||||
* Carrier for P2P interfaces is initially off and it is then
|
||||
* switched on and off when the remote peer is added or deleted.
|
||||
*/
|
||||
netif_carrier_off(dev);
|
||||
if (ovpn->mode == OVPN_MODE_MP)
|
||||
netif_carrier_on(dev);
|
||||
else
|
||||
netif_carrier_off(dev);
|
||||
|
||||
return register_netdevice(dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user