Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 Avoid NULL checks for a variable that is defini...
details: https://anonhg.NetBSD.org/src/rev/8cf544ba9268
branches: trunk
changeset: 337713:8cf544ba9268
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Apr 24 08:53:06 2015 +0000
description:
Avoid NULL checks for a variable that is definitely NULL
diffstat:
sys/netinet6/ip6_output.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diffs (46 lines):
diff -r e3fec31db5f2 -r 8cf544ba9268 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Fri Apr 24 07:51:43 2015 +0000
+++ b/sys/netinet6/ip6_output.c Fri Apr 24 08:53:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_output.c,v 1.163 2015/02/02 03:14:02 christos Exp $ */
+/* $NetBSD: ip6_output.c,v 1.164 2015/04/24 08:53:06 ozaki-r Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.163 2015/02/02 03:14:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.164 2015/04/24 08:53:06 ozaki-r Exp $");
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -167,7 +167,7 @@
bool tso;
struct route ip6route;
struct rtentry *rt = NULL;
- const struct sockaddr_in6 *dst = NULL;
+ const struct sockaddr_in6 *dst;
struct sockaddr_in6 src_sa, dst_sa;
int error = 0;
struct in6_ifaddr *ia = NULL;
@@ -543,8 +543,7 @@
/* scope check is done. */
if (rt == NULL || IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
- if (dst == NULL)
- dst = satocsin6(rtcache_getdst(ro));
+ dst = satocsin6(rtcache_getdst(ro));
KASSERT(dst != NULL);
} else if (opt && rtcache_validate(&opt->ip6po_nextroute) != NULL) {
/*
@@ -555,7 +554,7 @@
dst = (struct sockaddr_in6 *)opt->ip6po_nexthop;
} else if ((rt->rt_flags & RTF_GATEWAY))
dst = (struct sockaddr_in6 *)rt->rt_gateway;
- else if (dst == NULL)
+ else
dst = satocsin6(rtcache_getdst(ro));
/*
Home |
Main Index |
Thread Index |
Old Index