Lines Matching refs:rtnh
377 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining)
381 while (rtnh_ok(rtnh, remaining)) {
383 rtnh = rtnh_next(rtnh, &remaining);
390 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
396 if (!rtnh_ok(rtnh, remaining))
400 (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags;
401 nexthop_nh->nh_oif = rtnh->rtnh_ifindex;
402 nexthop_nh->nh_weight = rtnh->rtnh_hops + 1;
404 attrlen = rtnh_attrlen(rtnh);
406 struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
416 rtnh = rtnh_next(rtnh, &remaining);
427 struct rtnexthop *rtnh;
445 rtnh = cfg->fc_mp;
451 if (!rtnh_ok(rtnh, remaining))
454 if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->nh_oif)
457 attrlen = rtnh_attrlen(rtnh);
459 struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
471 rtnh = rtnh_next(rtnh, &remaining);
994 struct rtnexthop *rtnh;
1002 rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh));
1003 if (rtnh == NULL)
1006 rtnh->rtnh_flags = nh->nh_flags & 0xFF;
1007 rtnh->rtnh_hops = nh->nh_weight - 1;
1008 rtnh->rtnh_ifindex = nh->nh_oif;
1017 rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *) rtnh;