Page MenuHomeFreeBSD

route: Show weight of nexthop in multipath routes
ClosedPublic

Authored by pouria on Tue, Mar 31, 7:53 PM.
Tags
None
Referenced Files
F153092405: D56202.id.diff
Sun, Apr 19, 2:13 AM
F153089706: D56202.id174746.diff
Sun, Apr 19, 1:49 AM
F153064711: D56202.id174695.diff
Sat, Apr 18, 10:17 PM
F153059421: D56202.diff
Sat, Apr 18, 9:46 PM
Unknown Object (File)
Fri, Apr 17, 7:00 AM
Unknown Object (File)
Tue, Apr 14, 3:04 AM
Unknown Object (File)
Sun, Apr 12, 6:08 PM
Unknown Object (File)
Sun, Apr 12, 2:31 AM
Subscribers

Details

Summary

This revision is separated from D56191, since it also affects
route monitor, main goal of this change is usage from D56191.

Test Plan

Keep route monitor running and make a multipath route.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71900
Build 68783: arc lint + arc unit

Event Timeline

sbin/route/route_netlink.c
475

I'd recommend updating this comment accordingly.

490

The rtnh_weight is defined as unsigned. Certainly a negative weight does not make sense.

struct rta_mpath_nh {
        struct sockaddr *gw;
        uint32_t        ifindex;
        uint8_t         rtnh_flags;
        uint8_t         rtnh_weight;
        uint32_t        rtax_mtu;
        uint32_t        rta_rtflags;
        uint32_t        rta_expire;
};
pouria marked 2 inline comments as done.

Address @zlei comments.

sbin/route/route_netlink.c
490

If weight is 0, it's undefined.
But you're right, it's impossible now to be 0 since we overwrite it to RT_DEFAULT_WEIGHT anyway.
I've done it right in D55506, as time passes I tend to forgot :)

This revision is now accepted and ready to land.Wed, Apr 1, 3:18 PM