Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet CID 12164{49, 51}: Remove bogus ifp == NULL check...



details:   https://anonhg.NetBSD.org/src/rev/a8f2930fbb3b
branches:  trunk
changeset: 796317:a8f2930fbb3b
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 28 19:19:33 2014 +0000

description:
CID 12164{49,51}: Remove bogus ifp == NULL checks; if ifp was really NULL,
we would have been dead a few lines before the tests.

diffstat:

 sys/netinet/ip_input.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r bc3c8c3fdad1 -r a8f2930fbb3b sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Wed May 28 19:14:17 2014 +0000
+++ b/sys/netinet/ip_input.c    Wed May 28 19:19:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.314 2014/05/23 23:38:48 rmind Exp $     */
+/*     $NetBSD: ip_input.c,v 1.315 2014/05/28 19:19:33 christos Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.314 2014/05/23 23:38:48 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.315 2014/05/28 19:19:33 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -587,7 +587,7 @@
         * we get finer grain control.
         */
        checkif = ip_checkinterface && (ipforwarding == 0) &&
-           ifp && (ifp->if_flags & IFF_LOOPBACK) == 0;
+           (ifp->if_flags & IFF_LOOPBACK) == 0;
 
        /*
         * Check our list of addresses, to see if the packet is for us.
@@ -609,7 +609,7 @@
        }
        if (ia != NULL)
                goto ours;
-       if (ifp && ifp->if_flags & IFF_BROADCAST) {
+       if (ifp->if_flags & IFF_BROADCAST) {
                IFADDR_FOREACH(ifa, ifp) {
                        if (ifa->ifa_addr->sa_family != AF_INET)
                                continue;



Home | Main Index | Thread Index | Old Index