On 5/24/24 4:15 PM, Nikolay Aleksandrov wrote:
On 5/24/24 16:01, Daniel Borkmann wrote:
Implement the ndo_change_mtu callback in netkit in order to align the MTU
to the primary device. This is needed in order to sync MTUs to the latter
from the control plane (e.g. Cilium) which does not have access into the
Pod's netns.
Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
Cc: Joe Stringer <joe@xxxxxxxxx>
---
drivers/net/netkit.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
This one has unexpected behaviour IMO. If the app sets the MTU and we
silently overwrite, then it may continue working and thinking the MTU
was changed leading to unexpected problems. I think it'd be better to
keep the MTU synced explicitly (e.g. when set on main device, then
set it on peer as well) and error out when trying to set it without
the proper capabilities.
Makes sense, I'll look into this, thanks Nik!