diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-10-24 14:31:27 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-10-24 14:31:27 +0000 |
commit | d128aefde6c69651dd18f2957689f4dd447c08b4 (patch) | |
tree | b1d91b7ab479cae8d8a0247209306935c59207ff /sys/netinet/ip_carp.c | |
parent | 0a2f3e21288e3f3f66b9795c012651464c14939e (diff) |
Remove redundant duplicate packet length check.
ok mpf@
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r-- | sys/netinet/ip_carp.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index a61b0204924..c7cdeb850c0 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.110 2005/09/29 19:39:41 mpf Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.111 2005/10/24 14:31:26 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -435,31 +435,11 @@ carp_proto_input(struct mbuf *m, ...) return; } - iplen = ip->ip_hl << 2; - - if (m->m_pkthdr.len < iplen + sizeof(*ch)) { - carpstats.carps_badlen++; - CARP_LOG(sc, ("received len %d < %d on %s", - m->m_len - sizeof(struct ip), sizeof(*ch), - m->m_pkthdr.rcvif->if_xname)); - m_freem(m); - return; - } - - if (iplen + sizeof(*ch) < m->m_len) { - if ((m = m_pullup2(m, iplen + sizeof(*ch))) == NULL) { - carpstats.carps_hdrops++; - /* CARP_LOG ? */ - return; - } - ip = mtod(m, struct ip *); - } - ch = (void *)ip + iplen; - /* * verify that the received packet length is * equal to the CARP header */ + iplen = ip->ip_hl << 2; len = iplen + sizeof(*ch); if (len > m->m_pkthdr.len) { carpstats.carps_badlen++; |