Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Remove nullcheck, m is not allowed...



details:   https://anonhg.NetBSD.org/src/rev/9c7b76aa1290
branches:  trunk
changeset: 318450:9c7b76aa1290
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Apr 24 08:22:16 2018 +0000
description:
Remove nullcheck, m is not allowed to be null.

diffstat:

 sys/netinet6/nd6_rtr.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r bf60fc237113 -r 9c7b76aa1290 sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c    Tue Apr 24 08:10:32 2018 +0000
+++ b/sys/netinet6/nd6_rtr.c    Tue Apr 24 08:22:16 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $       */
+/*     $NetBSD: nd6_rtr.c,v 1.140 2018/04/24 08:22:16 maxv Exp $       */
 /*     $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $        */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.140 2018/04/24 08:22:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1118,12 +1118,10 @@
        int ss;
        char ip6buf[INET6_ADDRSTRLEN];
 
+       KASSERT(m != NULL);
        ND6_ASSERT_WLOCK();
 
-       auth = 0;
-       if (m) {
-               auth = (m->m_flags & M_AUTHIPHDR) ? 1 : 0;
-       }
+       auth = (m->m_flags & M_AUTHIPHDR) ? 1 : 0;
 
        if ((pr = nd6_prefix_lookup(newprc)) != NULL) {
                /*



Home | Main Index | Thread Index | Old Index