stack droping packets (netif_rx)
hi everyone,
i am trying to understand the interface between a device driver and the tcp/ip protocol stack on a linux 2.4.20 kernel. I met with some unknown's. here is wat i have tried.
i hooked up my driver (a very minimal pseudo driver) , which has a
{ hard_start_xmit:my_tx() }.
the stack when it wants to send a packet is sucessfully calling my
my_tx(sk_buff skb);
wht i did then was to do a
nskb=dev_alloc_skb(skb->len);
skb_put(nskb,skb->len);
memcpy(nskb->dat,skb->data,skb->len);
oh!!! i forgot to tell you , that i was checking my application with the ping utility..
then i interchanged the source and destination ip's in the payload,(ie nskb->data ). recalculated the checksum for ip. then changed the
icmp->type =oxo;(echo reply). and again recalculated the icmp checksum.
after this i tried to call
netif_rx(skb);
this call suceeds but, unfortunatley my packet is not deliverd to the ping application. i dont knwo why the stack is droping the packet on the way up.
if someones knows more about this i shall be very thankful if you could just share the information.
i also tried to sniff the packets with ethereal, its able to capture both the packets, there is no checksum error in my modified packet which i wanted to ping program to accept as a reply to its icmp echo reply..
i am stuck at this point.. if you need further info i shall be glad to post it.
hoping for a reply from friends in LQ..
|