problem on dummynet, please help me

=?gb2312?q?villy=20Luo?= lxp_welcome at yahoo.com.cn
Wed Nov 26 06:12:46 PST 2003


After reading the ip_dummynet.c, I found that dummynet
uses link list to store packets as the following code:

    if (q->head == NULL)
	q->head = pkt;
    else
	DN_NEXT(q->tail) = pkt;

    q->tail = pkt;
    q->len++;
    q->len_bytes += len ;

However, when I tried to use the following function to
get the length of the queue, I get the different value
to the q->len and the return is always 1.

static int getQueueLen(struct dn_flow_queue *q){
     struct dn_pkt * pFirst;
     int i;
	 pFirst = q->head;
	 for(i = 1 ; (pFirst != NULL); i ++){
        pFirst = DN_NEXT(pFirst);
	 }
	 return  i;
}


I donot know why this happens. Please help me slove
this problem. Million thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the freebsd-questions mailing list