[BACK]Return to tcpbench.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tcpbench

Diff for /src/usr.bin/tcpbench/tcpbench.c between version 1.39 and 1.40

version 1.39, 2013/12/20 02:04:09 version 1.40, 2013/12/24 22:26:20
Line 290 
Line 290 
 kfind_tcb(int sock)  kfind_tcb(int sock)
 {  {
         struct inpcbtable tcbtab;          struct inpcbtable tcbtab;
         struct inpcb *head, *next, *prev;          struct inpcb *next, *prev;
         struct inpcb inpcb;          struct inpcb inpcb;
         struct tcpcb tcpcb;          struct tcpcb tcpcb;
   
Line 322 
Line 322 
                 fprintf(stderr, "Using PCB table at %lu\n", ptb->ktcbtab);                  fprintf(stderr, "Using PCB table at %lu\n", ptb->ktcbtab);
 retry:  retry:
         kget(ptb->ktcbtab, &tcbtab, sizeof(tcbtab));          kget(ptb->ktcbtab, &tcbtab, sizeof(tcbtab));
         prev = head = (struct inpcb *)&TAILQ_FIRST(          prev = NULL;
             &((struct inpcbtable *)ptb->ktcbtab)->inpt_queue);  
         next = TAILQ_FIRST(&tcbtab.inpt_queue);          next = TAILQ_FIRST(&tcbtab.inpt_queue);
   
         if (ptb->vflag >= 2)          if (ptb->vflag >= 2)
                 fprintf(stderr, "PCB head at %p\n", head);                  fprintf(stderr, "PCB start at %p\n", next);
         while (next != head) {          while (next != NULL) {
                 if (ptb->vflag >= 2)                  if (ptb->vflag >= 2)
                         fprintf(stderr, "Checking PCB %p\n", next);                          fprintf(stderr, "Checking PCB %p\n", next);
                 kget((u_long)next, &inpcb, sizeof(inpcb));                  kget((u_long)next, &inpcb, sizeof(inpcb));
                 if (TAILQ_PREV(&inpcb, inpthead, inp_queue) != prev) {  
                         if (nretry--) {  
                                 warnx("pcb prev pointer insane");  
                                 goto retry;  
                         } else  
                                 errx(1, "pcb prev pointer insane,"  
                                      " all attempts exausted");  
                 }  
                 prev = next;                  prev = next;
                 next = TAILQ_NEXT(&inpcb, inp_queue);                  next = TAILQ_NEXT(&inpcb, inp_queue);
   

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40