netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 6/8] netfilter: ipv6: unnecessary to check whether ip6_route_output() returns NULL
Date: Wed, 13 Apr 2016 01:02:44 +0200	[thread overview]
Message-ID: <1460502166-20340-7-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1460502166-20340-1-git-send-email-pablo@netfilter.org>

From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 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;
 	}
-- 
2.1.4


  parent reply	other threads:[~2016-04-12 23:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 23:02 [PATCH 0/8] Netfilter updates for net-next Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 1/8] netfilter: nf_conntrack: Uses pr_fmt() for logging Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 2/8] netfilter: bridge: add nf_afinfo to enable queuing to userspace Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 3/8] netfilter: bridge: pass L2 header and VLAN as netlink attributes in queues " Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 4/8] netfilter: bridge: nf queue verdict to use NFQA_VLAN and NFQA_L2HDR Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 5/8] netfilter: ip6t_SYNPROXY: remove magic number for hop_limit Pablo Neira Ayuso
2016-04-12 23:02 ` Pablo Neira Ayuso [this message]
2016-04-12 23:02 ` [PATCH 7/8] netfilter: conntrack: de-inline nf_conntrack_eventmask_report Pablo Neira Ayuso
2016-04-12 23:02 ` [PATCH 8/8] netfilter: conntrack: move expectation event helper to ecache.c Pablo Neira Ayuso
2016-04-13  2:35 ` [PATCH 0/8] Netfilter updates for net-next David Miller

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=1460502166-20340-7-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /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).