Module Name:    src
Committed By:   maxv
Date:           Sat Mar 22 07:46:35 UTC 2014

Modified Files:
        src/sys/net: route.c

Log Message:
'newrt' is not supposed to be NULL. Therefore, the NULL-check in the if()
is pointless; and even if 'newrt' were NULL, 'rt' would be dereferenced
later. This is not a bug.

CID 270855

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/net/route.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.128 src/sys/net/route.c:1.129
--- src/sys/net/route.c:1.128	Tue Feb 25 18:30:12 2014
+++ src/sys/net/route.c	Sat Mar 22 07:46:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.128 2014/02/25 18:30:12 pooka Exp $	*/
+/*	$NetBSD: route.c,v 1.129 2014/03/22 07:46:35 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 #include "opt_route.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.128 2014/02/25 18:30:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.129 2014/03/22 07:46:35 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -341,7 +341,8 @@ rtalloc1(const struct sockaddr *dst, int
 				goto miss;
 			}
 			KASSERT(newrt != NULL);
-			if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
+			rt = newrt;
+			if (rt->rt_flags & RTF_XRESOLVE) {
 				msgtype = RTM_RESOLVE;
 				goto miss;
 			}

Reply via email to