Packet resending + IP filtering issues
ahuguet at cttc.es
ahuguet
Mon May 7 03:30:57 PDT 2007
> 4)
>
> I then tried to access the IP header field directly, but seems I'm missing
> something, since the printed numbers do not correspond to the expected
> protocol types.
>
> if (skb->len > 40){
> memcpy (&protocol,skb->data+20+9,1);
> printk(KERN_DEBUG "Protocol %d \n",protocol);
> }
>
> I add the 20, for the MAC header is 20 Bytes lenght, plus the 9 Bytes of
> offset corresponding to the IP header that follows. Protocol is a field a
> Byte lenght.
>
My mistake when typing this, I was thinking on IP header which is 20 Bytes
lenght.
The code used at attempt 4) is:
if (skb->len > 44){
memcpy (&protocol, skb->data+hdrlen+9,1);
printk(KERN_DEBUG "Protocol %d \n",protocol);
}
UDP datagrams, that should have a protocol number of 17, show 0 when using
the aforementioned code.
More information about the Hostap
mailing list