Lines Matching refs:rtnh
644 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining, in fib_count_nexthops() argument
649 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops()
651 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops()
678 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument
692 if (!rtnh_ok(rtnh, remaining)) { in fib_get_nhs()
698 if (rtnh->rtnh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) { in fib_get_nhs()
704 fib_cfg.fc_flags = (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs()
705 fib_cfg.fc_oif = rtnh->rtnh_ifindex; in fib_get_nhs()
707 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs()
709 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs()
751 rtnh->rtnh_hops + 1, extack); in fib_get_nhs()
755 rtnh = rtnh_next(rtnh, &remaining); in fib_get_nhs()
829 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument
868 struct rtnexthop *rtnh; in fib_nh_match() local
921 rtnh = cfg->fc_mp; in fib_nh_match()
927 if (!rtnh_ok(rtnh, remaining)) in fib_nh_match()
930 if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->fib_nh_oif) in fib_nh_match()
933 attrlen = rtnh_attrlen(rtnh); in fib_nh_match()
935 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_nh_match()
991 rtnh = rtnh_next(rtnh, &remaining); in fib_nh_match()
1716 struct rtnexthop *rtnh; in fib_add_nexthop() local
1719 rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh)); in fib_add_nexthop()
1720 if (!rtnh) in fib_add_nexthop()
1723 rtnh->rtnh_hops = nh_weight - 1; in fib_add_nexthop()
1724 rtnh->rtnh_ifindex = dev ? dev->ifindex : 0; in fib_add_nexthop()
1729 rtnh->rtnh_flags = flags; in fib_add_nexthop()
1735 rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *)rtnh; in fib_add_nexthop()