Page MenuHomeFreeBSD

rtnetlink: Fix weight overflow in RTA_MULTIPATH
ClosedPublic

Authored by pouria on May 27 2026, 10:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 16, 3:05 AM
Unknown Object (File)
Thu, Jul 16, 3:05 AM
Unknown Object (File)
Wed, Jul 15, 7:24 AM
Unknown Object (File)
Wed, Jul 15, 7:24 AM
Unknown Object (File)
Jun 17 2026, 1:38 PM
Unknown Object (File)
Jun 16 2026, 10:24 PM
Unknown Object (File)
Jun 16 2026, 1:05 PM
Unknown Object (File)
Jun 15 2026, 7:47 PM
Subscribers

Details

Summary

If the weight value is larger than 8 bits, set it to the maximum.
Also, only send RTA_WEIGHT if its value is not the default.
This reduces message size and matches the behavior of
non-multipath routes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netlink/route/rt.c
220

Use MAX()?

sys/netlink/route/rt.c
246

Doesn't this break backwards compatibility? Or is this code new enough that it doesn't matter?

pouria added inline comments.
sys/netlink/route/rt.c
246

This one is new.
I've added it in 84bb3648d2151 for backward compatibility with dump_rc_nhop. :D

This revision is now accepted and ready to land.May 27 2026, 9:21 PM