Changeset ec240f3789e4102e71fe1246fbff2af5f6fb3dc2

Show
Ignore:
Timestamp:
03/16/09 19:44:52 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1237232692 +0000
git-parent:

[5b175f1d6f70b127b0df3c66d53fff4ec99c769b]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1237232692 +0000
Message:

make ping cognizant of generation gaps on checks, fixes #107

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/ping_icmp.c

    r022695f rec240f3  
    4545struct ping_payload { 
    4646  uuid_t checkid; 
     47  u_int32_t generation;     
    4748  struct timeval whence; 
    4849  int    check_no; 
     
    154155  } from; 
    155156  unsigned int from_len; 
    156   struct ip *ip = (struct ip *)packet;; 
     157  struct ip *ip = (struct ip *)packet; 
    157158  struct icmp *icp; 
    158159  struct ping_payload *payload; 
     
    193194    } 
    194195    check = noit_poller_lookup(payload->checkid); 
     196    /* make sure this check is from this generation! */ 
    195197    if(!check) { 
    196198      char uuid_str[37]; 
     
    198200      noitLT(nlerr, now, 
    199201             "ping_icmp response for unknown check '%s'\n", uuid_str); 
     202      continue; 
     203    } 
     204    if(check->generation != payload->generation) { 
     205      noitLT(nldeb, now, 
     206             "ping_icmp response in generation gap\n"); 
    200207      continue; 
    201208    } 
     
    427434 
    428435    uuid_copy(payload->checkid, check->checkid); 
     436    payload->generation = check->generation; 
    429437    payload->check_no = ci->check_no; 
    430438    payload->check_pack_no = i;