[Openswan dev] DPD patch
Andrey Alexandrenko
aalexandrenko at telco-tech.de
Tue Sep 25 02:50:07 EDT 2012
Hallo,
I have a small DPD-patch, witch fixed for me DPD-messages flood in
2.6.35. There was some DPD-refactoring in 2.6.37 but I'm still using
this patch in 2.6.38, because the changes make the DPD-code just a bit
better and more senseful.
Regards, Andrey
diff -up ./programs/pluto/dpd.c.seqno ./programs/pluto/dpd.c
--- ./programs/pluto/dpd.c.seqno 2011-07-23 22:53:13.000000000 +0200
+++ ./programs/pluto/dpd.c 2011-12-15 10:37:07.507947829 +0100
@@ -516,17 +516,15 @@ dpd_inR(struct state *p1st
DBG_log("DPD: R_U_THERE_ACK, seqno received: %u expected: %u
(state=#%lu)",
seqno, p1st->st_dpd_expectseqno, p1st->st_serialno));
- if (!p1st->st_dpd_expectseqno && seqno != p1st->st_dpd_expectseqno) {
- loglog(RC_LOG_SERIOUS, "DPD: unexpected R_U_THERE_ACK packet
with sequence number %u", seqno);
- p1st->st_dpd_expectseqno = 0;
- /* do not update time stamp, so we'll send a new one sooner */
- } else {
+ if (seqno == p1st->st_dpd_expectseqno) {
/* update the time stamp */
p1st->st_last_dpd = tm;
+ p1st->st_dpd_expectseqno = 0;
+ } else if (!p1st->st_dpd_expectseqno) {
+ loglog(RC_LOG_SERIOUS, "DPD: unexpected R_U_THERE_ACK packet
with sequence number %u", seqno);
+ /* do not update time stamp, so we'll send a new one sooner */
}
- p1st->st_dpd_expectseqno = 0;
-
/*
* since there was activity, kill any EVENT_DPD_TIMEOUT that might
* be waiting.
More information about the Dev
mailing list