On Fri, 27 Nov 2026 09:31:04 -0500
Jon Maloy
From: Martin Schitter
The kernel splits large route dumps over several netlink datagrams, but nl_route_dup() currently only processes the first one, and fails with "Too many routes to duplicate" if there are more. This happens when there are more than about 50 routes on the template interface.
Change the code so that all datagrams are processed. Routes are copied to the destination namespace in three successive steps, to satisfy dependencies between them: - routes to local addresses - routes to local networks - routes with a gateway
This approach is inspired by the restore subcommand of iproute2.
Link: https://bugs.passt.top/show_bug.cgi?id=221 Signed-off-by: Martin Schitter
[jmaloy: Keep stripping of RTA_PREFSRC and RTA_NH_ID, bounds check on attribute types, style fixes] Signed-off-by: Jon Maloy
Applied, thanks both, and, Martin, welcome to the git log! I'll close https://bugs.passt.top/show_bug.cgi?id=221 as well as the Debian bug at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1146729 once this is in a release / package. -- Stefano