Page MenuHomeFreeBSD

rtnetlink: Fix weight overflow in RTA_MULTIPATH
ClosedPublic

Authored by pouria on May 27 2026, 10:03 AM.
Tags
None
Referenced Files
F162637944: D57266.diff
Wed, Jul 15, 7:24 AM
F162637943: D57266.diff
Wed, Jul 15, 7:24 AM
Unknown Object (File)
Wed, Jun 17, 1:38 PM
Unknown Object (File)
Tue, Jun 16, 10:24 PM
Unknown Object (File)
Tue, Jun 16, 1:05 PM
Unknown Object (File)
Jun 15 2026, 7:47 PM
Unknown Object (File)
Jun 8 2026, 4:29 PM
Unknown Object (File)
Jun 8 2026, 9:07 AM
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