summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2012-01-18 02:02:53 +0000
committeryasuoka <yasuoka@openbsd.org>2012-01-18 02:02:53 +0000
commit6117a981ef3432293f6dd4215845e2c8dd315eeb (patch)
tree13cdf1c5892e14784b74ff9762502406bffe6cd3
parentRemove assembly version of strlen from i386 and amd64, where it's (diff)
downloadwireguard-openbsd-6117a981ef3432293f6dd4215845e2c8dd315eeb.tar.xz
wireguard-openbsd-6117a981ef3432293f6dd4215845e2c8dd315eeb.zip
Fix a problem that causes LCP keepalive timeout. In case the ack number of
a packet that is passed to the userland has not incremented, `pipex' passed the packet mistakenly with invalid ack number. Then `npppd' will drop these packets, so that caused the problem. tested jmatthew ok jmatthew
-rw-r--r--sys/net/pipex.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/net/pipex.c b/sys/net/pipex.c
index 4faeed963cb..2210bb8a995 100644
--- a/sys/net/pipex.c
+++ b/sys/net/pipex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pipex.c,v 1.23 2011/11/25 13:05:06 yasuoka Exp $ */
+/* $OpenBSD: pipex.c,v 1.24 2012/01/18 02:02:53 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -1660,10 +1660,8 @@ pipex_pptp_input(struct mbuf *m0, struct pipex_session *session)
} else if (SEQ32_GT(ack, pptp_session->snd_nxt)) {
reason = "ack for unknown sequence";
goto out_seq;
- } else {
- ack++;
- pptp_session->snd_una = ack;
- }
+ } else
+ pptp_session->snd_una = ack + 1;
}
if (!has_seq) {
/* ack only packet */
@@ -1706,9 +1704,7 @@ pipex_pptp_input(struct mbuf *m0, struct pipex_session *session)
goto out_seq;
not_ours:
- /* revert original seq/ack values */
- seq--;
- ack--;
+ seq--; /* revert original seq value */
/*
* overwrite sequence numbers to adjust a gap between pipex and