diff options
| author | Antonio Quartulli <antonio@openvpn.net> | 2026-07-28 13:48:53 +0200 |
|---|---|---|
| committer | Antonio Quartulli <antonio@openvpn.net> | 2026-07-30 11:28:30 +0200 |
| commit | 0301aa324941698bec3dd455df1c5abc7afb10db (patch) | |
| tree | b242f606f269880b9a8846e06fe4b08a0d0ebf13 /tools/perf/scripts/python/flamegraph.py | |
| parent | b47a52dcd598a50207a33df304acdf45348a690f (diff) | |
ovpn: disable IPv4 redirects on MP interfaces
ovpn_mp_alloc() tried to disable SEND_REDIRECTS on a multipeer
interface, but it runs from ovpn_net_init() (->ndo_init), which
register_netdevice() invokes before the NETDEV_REGISTER notifier
chain. The IPv4 in_device is only created when that notifier reaches
inetdev_event() -> inetdev_init(), so __in_dev_get_rtnl() always
returned NULL at ndo_init time and the whole redirect-disabling block
(both the per-device and the per-netns IPV4_DEVCONF_ALL write) was
dead. MP interfaces therefore kept emitting ICMP redirects.
Disabling redirects only once is not enough either: the IPv4
in_device is destroyed and recreated when the interface is moved to a
different network namespace (NETDEV_UNREGISTER/NETDEV_REGISTER), and
the newly created in_device inherits the destination namespace
defaults, silently re-enabling SEND_REDIRECTS.
Disable redirects from ovpn_net_open() (->ndo_open) instead: it runs
every time the interface is brought up, including after the in_device
has been recreated, so the setting is always re-applied. This mirrors
what wireguard does in wg_open(). RTNL is held on the ndo_open() path,
so __in_dev_get_rtnl() is safe.
Fixes: 05003b408c20 ("ovpn: implement multi-peer support")
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
