On 8/31/19 6:22 AM, Donald Sharp wrote:
> @@ -1684,7 +1684,8 @@ EXPORT_SYMBOL_GPL(fib_add_nexthop);
>  #endif
>  
>  #ifdef CONFIG_IP_ROUTE_MULTIPATH
> -static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi)
> +static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi,
> +                          u8 rt_family)

The fib_info argument makes this an IPv4 only function, so the rt_family
is extraneous. Remove it here and the #else path below and use AF_INET
for the 2 calls below.

>  {
>       struct nlattr *mp;
>  
> @@ -1693,13 +1694,14 @@ static int fib_add_multipath(struct sk_buff *skb, 
> struct fib_info *fi)
>               goto nla_put_failure;
>  
>       if (unlikely(fi->nh)) {
> -             if (nexthop_mpath_fill_node(skb, fi->nh) < 0)
> +             if (nexthop_mpath_fill_node(skb, fi->nh, rt_family) < 0)
>                       goto nla_put_failure;
>               goto mp_end;
>       }
>  
>       for_nexthops(fi) {
> -             if (fib_add_nexthop(skb, &nh->nh_common, nh->fib_nh_weight) < 0)
> +             if (fib_add_nexthop(skb, &nh->nh_common, nh->fib_nh_weight,
> +                                 rt_family) < 0)
>                       goto nla_put_failure;
>  #ifdef CONFIG_IP_ROUTE_CLASSID
>               if (nh->nh_tclassid &&
> @@ -1717,7 +1719,8 @@ static int fib_add_multipath(struct sk_buff *skb, 
> struct fib_info *fi)
>       return -EMSGSIZE;
>  }
>  #else
> -static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi)
> +static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi,
> +                          u8 family)
>  {
>       return 0;
>  }

Reply via email to