netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Donald Sharp <sharpd@cumulusnetworks.com>,
	netdev@vger.kernel.org, dsahern@kernel.org,
	sworley@cumulusnetworks.com
Subject: Re: [PATCH v2 net] net: Properly update v4 routes with v6 nexthop
Date: Tue, 3 Sep 2019 16:17:10 -0600	[thread overview]
Message-ID: <4cecf207-775c-6b40-8152-66880de2be58@gmail.com> (raw)
In-Reply-To: <20190831122254.29928-1-sharpd@cumulusnetworks.com>

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;
>  }

      parent reply	other threads:[~2019-09-03 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-31 12:22 [PATCH v2 net] net: Properly update v4 routes with v6 nexthop Donald Sharp
2019-09-01  2:21 ` David Ahern
2019-09-03 22:17 ` David Ahern [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cecf207-775c-6b40-8152-66880de2be58@gmail.com \
    --to=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sharpd@cumulusnetworks.com \
    --cc=sworley@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).