Also, fix weight overflow of RTA_MULTIPATH, use metric instead
Our weight values are 24-bit. In the original netlink, rtnh_hops is
indeed 8-bit. For backward compatibility, send metric instead of increasing
its size and also send RTA_WEIGHT for multipath routes.
Details
See patches to the route(8) command in the stack revision.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 72093 Build 68976: arc lint + arc unit
Event Timeline
These changes can be tested in latter route revisions in the revision stack.
| sys/netlink/route/route.h | ||
|---|---|---|
| 336 | It would be awesome to increase rtnh_hops size here. | |
| sys/netlink/route/rt.c | ||
| 220 | This is where I changed the rtnh_nhops from weight to metric. You can verify the invalid values by using route -n6 monitor and adding a weight bigger than 8-bit value. | |
| 227 | To preserve the functionality. I return the weight using another well-known TLV here and I also document it in next revision. | |
| 907–908 | If user filled the metric, add it to weight. Good for backward compatibility. Simple logic. | |
| sys/netlink/route/rt.c | ||
|---|---|---|
| 907–908 |
With new attribute, I removed the dirty hack and the sentence above is no longer true. | |