--- gvpe/src/util.h 2005/03/23 21:55:39 1.17 +++ gvpe/src/util.h 2007/11/10 05:14:22 1.20 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with gvpe; if not, write to the Free Software - Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef UTIL_H__ @@ -29,7 +29,10 @@ #include "gettext.h" #include "slog.h" -#include "iom.h" +#include "ev_cpp.h" +#include "callback.h" + +typedef ev::ev_tstamp tstamp; /* * check for an existing gvpe for this net, and write pid to pidfile @@ -73,10 +76,10 @@ { if (seqno <= seq - WINDOWSIZE) slog (L_ERR, _("received duplicate or outdated packet (received %08lx, expected %08lx)\n" - "possible replay attack, or just massive packet reordering"), seqno, seq + 1);//D - else if (seqno > seq + WINDOWSIZE) + "possible replay attack, or just massive packet reordering"), seqno, seq + 1); + else if (seqno > seq + WINDOWSIZE * 4) slog (L_ERR, _("received duplicate or out-of-sync packet (received %08lx, expected %08lx)\n" - "possible replay attack, or just massive packet loss"), seqno, seq + 1);//D + "possible replay attack, or just massive packet loss"), seqno, seq + 1); else { while (seqno > seq) @@ -95,17 +98,16 @@ u32 mask = 1 << (s & 31); if (*cell & mask) - { - slog (L_ERR, _("received duplicate packet (received %08lx, expected %08lx)\n" - "possible replay attack, or just packet duplication"), seqno, seq + 1);//D - return false; - } + slog (L_ERR, _("received duplicate packet (received %08lx, expected %08lx)\n" + "possible replay attack, or just packet duplication"), seqno, seq + 1); else { *cell |= mask; return true; } } + + return false; } };