Page MenuHomeFreeBSD

rtnetlink: Fix weight overflow in RTA_MULTIPATH
ClosedPublic

Authored by pouria on Wed, May 27, 10:03 AM.
Tags
None
Referenced Files
F158286187: D57266.id178733.diff
Sat, May 30, 7:23 PM
F158262295: D57266.id.diff
Sat, May 30, 12:50 PM
F158232064: D57266.diff
Sat, May 30, 2:57 AM
Unknown Object (File)
Fri, May 29, 7:45 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.Wed, May 27, 9:21 PM