Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 check version before computing checksum. check...



details:   https://anonhg.NetBSD.org/src/rev/b3815e4664b7
branches:  trunk
changeset: 547227:b3815e4664b7
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu May 15 13:46:15 2003 +0000

description:
check version before computing checksum.  checksum is more expensive operation.

diffstat:

 sys/netinet6/ip6_mroute.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (56 lines):

diff -r b2c7e1cb9804 -r b3815e4664b7 sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c Thu May 15 13:30:31 2003 +0000
+++ b/sys/netinet6/ip6_mroute.c Thu May 15 13:46:15 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_mroute.c,v 1.44 2003/05/14 17:02:59 itojun Exp $   */
+/*     $NetBSD: ip6_mroute.c,v 1.45 2003/05/15 13:46:15 itojun Exp $   */
 /*     $KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $     */
 
 /*
@@ -85,7 +85,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.44 2003/05/14 17:02:59 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.45 2003/05/15 13:46:15 itojun Exp $");
 
 #include "opt_inet.h"
 
@@ -1671,6 +1671,18 @@
                return IPPROTO_DONE;
        }
 
+       /* PIM version check */
+       if (pim->pim_ver != PIM_VERSION) {
+               ++pim6stat.pim6s_rcv_badversion;
+#ifdef MRT6DEBUG
+               log(LOG_ERR,
+                   "pim6_input: incorrect version %d, expecting %d\n",
+                   pim->pim_ver, PIM_VERSION);
+#endif
+               m_freem(m);
+               return (IPPROTO_DONE);
+       }
+
 #define PIM6_CHECKSUM
 #ifdef PIM6_CHECKSUM
        {
@@ -1698,18 +1710,6 @@
        }
 #endif /* PIM_CHECKSUM */
 
-       /* PIM version check */
-       if (pim->pim_ver != PIM_VERSION) {
-               ++pim6stat.pim6s_rcv_badversion;
-#ifdef MRT6DEBUG
-               log(LOG_ERR,
-                   "pim6_input: incorrect version %d, expecting %d\n",
-                   pim->pim_ver, PIM_VERSION);
-#endif
-               m_freem(m);
-               return (IPPROTO_DONE);
-       }
-
        if (pim->pim_type == PIM_REGISTER) {
                /*
                 * since this is a REGISTER, we'll make a copy of the register



Home | Main Index | Thread Index | Old Index