diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-05-15 13:52:14 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-05-15 13:52:14 +0000 |
commit | 1834f1e70f6b015219c87aae683639d4c1fcdb23 (patch) | |
tree | 49ddb48e35b9bbcf53403d8c43fa6847e64bc7b1 /sys/netinet6 | |
parent | 348ee6d7826f44917be9a2497c2f617f7fd9cb5e (diff) |
check pim version before checksum. version check is cheaper.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index a1cce460953..042a9e87ee7 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.c,v 1.34 2003/05/14 17:05:34 itojun Exp $ */ +/* $OpenBSD: ip6_mroute.c,v 1.35 2003/05/15 13:52:13 itojun Exp $ */ /* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */ /* @@ -1687,6 +1687,18 @@ pim6_input(mp, offp, proto) 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 { @@ -1714,18 +1726,6 @@ pim6_input(mp, offp, proto) } #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 |