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;
        DN_NEXT(q->tail) = pkt;

    q->tail = pkt;
    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 
[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to