From: octo Date: Fri, 12 May 2006 15:32:18 +0000 (+0000) Subject: octo@huhu:~/liboping $ svn merge -r2:3 trunk branches/liboping-0.1 X-Git-Tag: liboping-0.1.1~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=767dcf1d62725888cb9f7beb3dbd5257835db6b1;hp=1becd0cc4b4c4a69f3b8efecb920d7a59b8d2ab4;p=liboping.git octo@huhu:~/liboping $ svn merge -r2:3 trunk branches/liboping-0.1 --- diff --git a/src/liboping.c b/src/liboping.c index af29a64..778ef07 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -256,7 +256,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; @@ -267,7 +267,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", @@ -319,7 +319,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; @@ -330,7 +330,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", @@ -1135,6 +1135,7 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info, ret = 0; break; + /* FIXME Return the sequence as an unsigned int */ case PING_INFO_SEQUENCE: ret = ENOMEM; *buffer_len = sizeof (uint16_t);