linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL
@ 2016-04-03 14:03 Haishuang Yan
  2016-04-07 16:53 ` [netfilter-core] " Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Haishuang Yan @ 2016-04-03 14:03 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris
  Cc: netfilter-devel, coreteam, netdev, linux-kernel, Haishuang Yan

ip6_route_output() never returns NULL, so it is not appropriate to
check if the return value is NULL.

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv6/netfilter/nf_reject_ipv6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index 4709f65..a540022 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -158,7 +158,7 @@ void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook)
 	fl6.fl6_dport = otcph->source;
 	security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
 	dst = ip6_route_output(net, NULL, &fl6);
-	if (dst == NULL || dst->error) {
+	if (dst->error) {
 		dst_release(dst);
 		return;
 	}
-- 
1.8.3.1

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

* Re: [netfilter-core] [PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL
  2016-04-03 14:03 [PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL Haishuang Yan
@ 2016-04-07 16:53 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-04-07 16:53 UTC (permalink / raw)
  To: Haishuang Yan
  Cc: David S. Miller, Alexey Kuznetsov, James Morris, netdev,
	coreteam, netfilter-devel, linux-kernel

On Sun, Apr 03, 2016 at 10:03:33PM +0800, Haishuang Yan wrote:
> ip6_route_output() never returns NULL, so it is not appropriate to
> check if the return value is NULL.

Applied, thanks.

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

end of thread, other threads:[~2016-04-07 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-03 14:03 [PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL Haishuang Yan
2016-04-07 16:53 ` [netfilter-core] " Pablo Neira Ayuso

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