On 11/27/26 15:31, Jon Maloy wrote:
v2 (Jon Maloy): Martin hasn't been available lately, so I picked this up, with Stefano's consent: - RTA_OIF, RTA_MULTIPATH, RTA_PREFSRC and RTA_NH_ID were handled in a single if/else chain, but they're not mutually exclusive: as almost every route has RTA_OIF, RTA_PREFSRC and RTA_NH_ID were no longer stripped, which caused the EINVAL Stefano reported with a /31 template address and -a. Strip them independently again, as the original code did
Thanks for this finding! It looks like plausible solution to me, but I don't have an adequate test environment to check it more carefully in practice.
- Ignore attribute types above RTA_MAX instead of writing past tb[]
That's a really important additional improvement -- thanks!
- Tested with Stefano's reproducer, with 300 routes on the template interface, and with routes copied together with the device route for the gateway. IMHO it's really important to collect this kind of test scenarios, because nobody can fully grasp the complexity of these issues and future kernel changes.
Thanks for your work -- It looks good to me! Martin