summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-04-05 02:37:07 +0000
committerStef Walter <stef@memberwebs.com>2006-04-05 02:37:07 +0000
commit848edc95d77b01542a9252c5af128595b5862121 (patch)
tree8a87d6db85d05d1c9d448b093dc5f75762c987c7
parent1d75c6e061336bc86f5949093aa4170c46fa25cd (diff)
Fix problem with short overflows not working properly.
-rw-r--r--module/bsnmp-ping.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/bsnmp-ping.c b/module/bsnmp-ping.c
index 029acdb..d63e0a9 100644
--- a/module/bsnmp-ping.c
+++ b/module/bsnmp-ping.c
@@ -38,6 +38,7 @@
#include "usuals.h"
#include <sys/types.h>
+#include <sys/limits.h>
#include <sys/socket.h>
#include <sys/queue.h>
#include <sys/select.h>
@@ -307,7 +308,7 @@ ping_fire (void *user_data)
memset (icmp_packet, 0, sizeof (icmp_packet));
ping->at = (ping->at + ((ping->transmitted > 1) ? 1 : 0)) % ping->history;
- seq = ping->transmitted;
+ seq = ping->transmitted % USHRT_MAX;
ASSERT (ping->transmitted == 0 ||
(ping->transmitted % ping->history) == ((ping->at + 1) % ping->history));