My  example was of course wrong:
the hint from Gigi Sullivan was correct - Thanks

if (skb->nh.iph->saddr==6)
                          ^^^^^           must be ...->protocol
     x=skb->h.th->source;

I need to fingure out to wich source and destination port a packet goes.
Thanks to Christoph Mause for his example that can do that:

if (sk->protocol == 6)               //Ist das Transportprotokoll TCP?
{
   s_address = sk->saddr;            //Hiermit erhalte die die IP-
Source Adresse
   d_address = sk->daddr;            //Hier die IP- Destination Adresse
   sport     = sk->sport;            //Somit bekommt man den Source Port
   dport     = sk->dport;            //und so den Destination Port
}
else
   printk(KERN_WARNING "Transportprotokoll ist nicht TCP\n");


My Question is:
Why is the struct sk_buff h not filled and the pointer of  n.th->source
points to the wrong adress?
I found the struct in the file sk_buff.h and there is the union h defined.
Why is it defined but not used?
Perhaps i have a wrong kernel-config?

Thank you for further help.

Regards
Andreas Rennen


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to