summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2007-08-28 15:59:19 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2007-08-28 15:59:19 +0000
commitb8733342a874cb8dd010675510eb731bcb132401 (patch)
treef71ec0cd10efc0eef6f0d6f7f9493a8f106f312d
parentd2950d6d509d2bea218a97152d35e4c1b10abb5e (diff)
The m_pulldown used for aligning was not copying the header,
revert back to m_pullup2. Reported and tested by Enache Adrian additional testing by naddy@ and claudio@ ok claudio@, deraadt@
-rw-r--r--sys/net/if_spppsubr.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index f79ce3c87ea..aab3ef08e19 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.55 2007/08/20 16:46:00 canacar Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.56 2007/08/28 15:59:18 canacar Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -481,14 +481,16 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
}
/* preserve the alignment */
- m = m_pulldown(m, 0, m->m_pkthdr.len, NULL);
- if (m == NULL) {
- if (debug)
- log(LOG_DEBUG,
- SPP_FMT "Failed to align packet!\n", SPP_ARGS(ifp));
- ++ifp->if_ierrors;
- ++ifp->if_iqdrops;
- return;
+ if (m->m_len < m->m_pkthdr.len) {
+ m = m_pullup2(m, m->m_pkthdr.len);
+ if (m == NULL) {
+ if (debug)
+ log(LOG_DEBUG,
+ SPP_FMT "Failed to align packet!\n", SPP_ARGS(ifp));
+ ++ifp->if_ierrors;
+ ++ifp->if_iqdrops;
+ return;
+ }
}
switch (h->address) {