* data structures for convenience.
*/
struct netlink_nh_info {
+ /* Weight of the nexthop ( for unequal cost ECMP ) */
+ uint8_t weight;
uint32_t if_index;
union g_addr *gateway;
nhi.recursive = nexthop->rparent ? 1 : 0;
nhi.type = nexthop->type;
nhi.if_index = nexthop->ifindex;
+ nhi.weight = nexthop->weight;
if (nexthop->type == NEXTHOP_TYPE_IPV4
|| nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
if (nexthop->type == NEXTHOP_TYPE_IPV6
|| nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
- nhi.gateway = &nexthop->gate;
+ /* Special handling for IPv4 route with IPv6 Link Local next hop
+ */
+ if (ri->af == AF_INET)
+ nhi.gateway = &ipv4ll_gateway;
+ else
+ nhi.gateway = &nexthop->gate;
}
if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
ri->af = rib_dest_af(dest);
if (zvrf && zvrf->zns)
- ri->nlmsg_pid = zvrf->zns->netlink_dplane.snl.nl_pid;
+ ri->nlmsg_pid = zvrf->zns->netlink_dplane_out.snl.nl_pid;
ri->nlmsg_type = cmd;
ri->rtm_table = table_info->table_id;
rtnh->rtnh_ifindex = nhi->if_index;
}
+ rtnh->rtnh_hops = nhi->weight;
+
encap = nhi->encap_info.encap_type;
switch (encap) {
case FPM_NH_ENCAP_NONE: