summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6995e2c)
raw | patch | inline | side by side (parent: 6995e2c)
author | octo <octo> | |
Tue, 9 May 2006 05:34:03 +0000 (05:34 +0000) | ||
committer | octo <octo> | |
Tue, 9 May 2006 05:34:03 +0000 (05:34 +0000) |
src/liboping.c | patch | blob | history |
diff --git a/src/liboping.c b/src/liboping.c
index 9e9d6c21755f9247d762cd848deef63b8bb33e6a..b92609036bd73df038a80db6d472cceec44a3ffb 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
@@ -260,7 +260,7 @@ static pinghost_t *ping_receive_ipv4 (pinghost_t *ph, char *buffer, size_t buffe
for (ptr = ph; ptr != NULL; ptr = ptr->next)
{
dprintf ("hostname = %s, ident = 0x%04x, seq = %i\n",
- ptr->hostname, ptr->ident, ptr->sequence - 1);
+ ptr->hostname, ptr->ident, ((ptr->sequence - 1) & 0xFFFF));
if (ptr->addrfamily != AF_INET)
continue;
@@ -271,7 +271,7 @@ static pinghost_t *ping_receive_ipv4 (pinghost_t *ph, char *buffer, size_t buffe
if (ptr->ident != ident)
continue;
- if ((ptr->sequence - 1) != seq)
+ if (((ptr->sequence - 1) & 0xFFFF) != seq)
continue;
dprintf ("Match found: hostname = %s, ident = 0x%04x, seq = %i\n",
@@ -323,7 +323,7 @@ static pinghost_t *ping_receive_ipv6 (pinghost_t *ph, char *buffer, size_t buffe
for (ptr = ph; ptr != NULL; ptr = ptr->next)
{
dprintf ("hostname = %s, ident = 0x%04x, seq = %i\n",
- ptr->hostname, ptr->ident, ptr->sequence - 1);
+ ptr->hostname, ptr->ident, ((ptr->sequence - 1) & 0xFFFF));
if (ptr->addrfamily != AF_INET6)
continue;
@@ -334,7 +334,7 @@ static pinghost_t *ping_receive_ipv6 (pinghost_t *ph, char *buffer, size_t buffe
if (ptr->ident != ident)
continue;
- if ((ptr->sequence - 1) != seq)
+ if (((ptr->sequence - 1) & 0xFFFF) != seq)
continue;
dprintf ("Match found: hostname = %s, ident = 0x%04x, seq = %i\n",
ret = 0;
break;
+ /* FIXME Return the sequence as an unsigned int */
case PING_INFO_SEQUENCE:
ret = ENOMEM;
*buffer_len = sizeof (uint16_t);