linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv4: fix error return code in rtm_to_fib_config()
@ 2020-12-04  8:48 Zhang Changzhong
  2020-12-04 16:04 ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Changzhong @ 2020-12-04  8:48 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Jakub Kicinski, David Ahern
  Cc: Zhang Changzhong, netdev, linux-kernel

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
 net/ipv4/fib_frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index b87140a..cdf6ec5 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -825,7 +825,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
 	if (has_gw && has_via) {
 		NL_SET_ERR_MSG(extack,
 			       "Nexthop configuration can not contain both GATEWAY and VIA");
-		goto errout;
+		return -EINVAL;
 	}
 
 	return 0;
-- 
2.9.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ipv4: fix error return code in rtm_to_fib_config()
  2020-12-04  8:48 [PATCH net] ipv4: fix error return code in rtm_to_fib_config() Zhang Changzhong
@ 2020-12-04 16:04 ` David Ahern
  2020-12-04 23:40   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2020-12-04 16:04 UTC (permalink / raw)
  To: Zhang Changzhong, David S. Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, Jakub Kicinski
  Cc: netdev, linux-kernel

On 12/4/20 1:48 AM, Zhang Changzhong wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
>  net/ipv4/fib_frontend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
> index b87140a..cdf6ec5 100644
> --- a/net/ipv4/fib_frontend.c
> +++ b/net/ipv4/fib_frontend.c
> @@ -825,7 +825,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
>  	if (has_gw && has_via) {
>  		NL_SET_ERR_MSG(extack,
>  			       "Nexthop configuration can not contain both GATEWAY and VIA");
> -		goto errout;
> +		return -EINVAL;
>  	}
>  
>  	return 0;
> 

Thanks for the patch.

Reviewed-by: David Ahern <dsahern@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ipv4: fix error return code in rtm_to_fib_config()
  2020-12-04 16:04 ` David Ahern
@ 2020-12-04 23:40   ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-04 23:40 UTC (permalink / raw)
  To: David Ahern, Zhang Changzhong
  Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI, netdev,
	linux-kernel

On Fri, 4 Dec 2020 09:04:08 -0700 David Ahern wrote:
> On 12/4/20 1:48 AM, Zhang Changzhong wrote:
> > Fix to return a negative error code from the error handling
> > case instead of 0, as done elsewhere in this function.
> > 
> > Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes")
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> 
> Reviewed-by: David Ahern <dsahern@kernel.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-04 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  8:48 [PATCH net] ipv4: fix error return code in rtm_to_fib_config() Zhang Changzhong
2020-12-04 16:04 ` David Ahern
2020-12-04 23:40   ` Jakub Kicinski

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).