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)
Fri, Oct 2, 6:07 PM
Unknown Object (File)
Fri, Oct 2, 8:13 AM
Unknown Object (File)
Fri, Oct 2, 4:20 AM
Unknown Object (File)
Wed, Sep 30, 11:21 PM
Unknown Object (File)
Mon, Sep 28, 4:22 PM
Unknown Object (File)
Sun, Sep 27, 10:46 PM
Unknown Object (File)
Sun, Sep 27, 8:01 PM
Unknown Object (File)
Sat, Sep 26, 10:12 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