On 05/11/2024 11:33, Sabrina Dubroca wrote:
2024-10-29, 11:47:33 +0100, Antonio Quartulli wrote:
+int ovpn_nl_key_swap_notify(struct ovpn_peer *peer, u8 key_id)
+{
[...]
+
+ nla_nest_end(msg, k_attr);
+ genlmsg_end(msg, hdr);
+
+ genlmsg_multicast_netns(&ovpn_nl_family, dev_net(peer->ovpn->dev), msg,
+ 0, OVPN_NLGRP_PEERS, GFP_ATOMIC);
+
Is openvpn meant to support moving the device to a different netns? In
that case I'm not sure the netns the ovpn netdevice is in is the right
one, the userspace client will be in the encap socket's netns instead
of the netdevice's?
(same thing in the next patch)
Well, moving between netns's may not be among the most common use cases,
but I can see people doing all kind of weird things, if not forbidden.
Hence, I would not assume the netdevice to always stay in the same netns
all time long.
This said, what you say assumes that the userspace process won't change
netns after having added the peer.
I think we can live with that.
I will change this call to use the sock's netns then.
Thanks a lot!
Regards,
--
Antonio Quartulli
OpenVPN Inc.