Page MenuHomeFreeBSD

route: Show weight of nexthop in multipath routes
ClosedPublic

Authored by pouria on Tue, Mar 31, 7:53 PM.

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 Not Applicable
Unit
Tests Not Applicable

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