summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcanacar <canacar@openbsd.org>2007-08-07 17:15:13 +0000
committercanacar <canacar@openbsd.org>2007-08-07 17:15:13 +0000
commitb41aa99fecd7123a4dda239a9ff4baec3781549c (patch)
tree7998f46ada53ff942d441b7999b7268288850a24
parentCorrect value for power state D1. (diff)
downloadwireguard-openbsd-b41aa99fecd7123a4dda239a9ff4baec3781549c.tar.xz
wireguard-openbsd-b41aa99fecd7123a4dda239a9ff4baec3781549c.zip
Use the length of the mbuf instead of the packet.
When sending a protocol reject. Prevents reading past the mbuf in case the mbuf does not cover the whole packet. ok claudio@, henning@
-rw-r--r--sys/net/if_spppsubr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index f434fbb5c79..b5d7c1f5a5b 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.52 2007/06/06 10:04:36 henning Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.53 2007/08/07 17:15:13 canacar Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -500,7 +500,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
default:
if (sp->state[IDX_LCP] == STATE_OPENED)
sppp_cp_send (sp, PPP_LCP, PROTO_REJ,
- ++sp->pp_seq, m->m_pkthdr.len + 2, prej);
+ ++sp->pp_seq, m->m_len + 2, prej);
if (debug)
log(LOG_DEBUG,
SPP_FMT "invalid input protocol "