version 1.38, 2013/12/24 22:26:20 |
version 1.39, 2013/12/25 01:46:00 |
|
|
read_ns(void) |
read_ns(void) |
{ |
{ |
struct inpcbtable pcbtable; |
struct inpcbtable pcbtable; |
struct inpcb *next; |
struct inpcb *next, *prev; |
struct inpcb inpcb; |
struct inpcb inpcb, prevpcb; |
struct socket sockb; |
struct socket sockb; |
struct tcpcb tcpcb; |
struct tcpcb tcpcb; |
void *off; |
void *off; |
|
|
again: |
again: |
KREAD(off, &pcbtable, sizeof (struct inpcbtable)); |
KREAD(off, &pcbtable, sizeof (struct inpcbtable)); |
|
|
|
prev = NULL; |
next = TAILQ_FIRST(&pcbtable.inpt_queue); |
next = TAILQ_FIRST(&pcbtable.inpt_queue); |
|
|
while (next != NULL) { |
while (next != NULL) { |
KREAD(next, &inpcb, sizeof (inpcb)); |
KREAD(next, &inpcb, sizeof (inpcb)); |
|
if (prev != NULL) { |
|
KREAD(prev, &prevpcb, sizeof (prevpcb)); |
|
if (TAILQ_NEXT(&prevpcb, inp_queue) != next) { |
|
error("Kernel state in transition"); |
|
return 0; |
|
} |
|
} |
|
prev = next; |
next = TAILQ_NEXT(&inpcb, inp_queue); |
next = TAILQ_NEXT(&inpcb, inp_queue); |
|
|
if (!aflag) { |
if (!aflag) { |