Problem with ip_forward.c
February 14, 2011 04:25PM
Hello.
I would like to modify the ip_forward.c file to make a new Linux kernel.
But during the compilation, there are a lot of error messages :
"
net/ipv4/ip_forward.c: In function ‘ip_forward’:
net/ipv4/ip_forward.c:77: error: ‘struct sk_buff’ has no member named ‘list’
net/ipv4/ip_forward.c:79: warning: passing argument 1 of ‘skb_queue_len’
from incompatible pointer type
include/linux/skbuff.h:841: note: expected ‘const struct sk_buff_head *’
but argument is of type ‘struct tcp_sock *’
net/ipv4/ip_forward.c:81: warning: passing argument 1 of ‘skb_queue_head’
from incompatible pointer type
include/linux/skbuff.h:1015: note: expected ‘struct sk_buff_head *’ but
argument is of type ‘struct tcp_sock *’
net/ipv4/ip_forward.c:85: warning: passing argument 1 of ‘skb_queue_len’
from incompatible pointer type
include/linux/skbuff.h:841: note: expected ‘const struct sk_buff_head *’
but argument is of type ‘struct tcp_sock *’
net/ipv4/ip_forward.c:87: warning: passing argument 1 of ‘__skb_dequeue’
from incompatible pointer type
include/linux/skbuff.h:1065: note: expected ‘struct sk_buff_head *’ but
argument is of type ‘struct tcp_sock *’
"
And this is my code :
"
skb_queue_head_init(&skb->list); //initialise le buffer
int nbSuppr;
int i=0;
int j=1;
printk("\n\nBuffer initialisé !"winking smiley;
while(skb_queue_len(list)<100)
{
skb_queue_head(list, skb); //on met le paquet dans la liste
printk("\n\n Paquet n° %d mis dans le buffer !",j);
j++;
}
nbSuppr = (0.3*skb_queue_len(list));
printk("\n\n Il faut suprimer %d paquets !",nbSuppr);
skb = __skb_dequeue(list);
while (i<nbSuppr)
{
kfree_skb(skb);
printk("\n\n Paquet n° %d supprimé !",i);
i++;
goto drop;
}
printk("\n\n Paquet n° %d gardé !",i);
"

I think it's a problem with skb functions but I can't see what is the problem.
I need help.
Thank you.
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 17 plus 5?
Message: