> am un pachet udp intr-un modul de kernel si incerc sa aflu portul
> UDP prin urmatoarea secventa :
> if(sb->nh.iph->protocol==IPPROTO_ UDP))
> { ...
> struct uhdr *uhead=sb->h.uh;
salut,
nu poti sa referi astfel header-ul UDP dintr-o structura sk_buff;
metoda corecta este:
struct udphdr *uhead;
uhead = (struct udphdr *) (sb->data + (sb->nh.iph->ihl * 4));
if (uhead->dest = htons (port))
...
trebuie intodeauna sa referi header-ul corespunzator UDP sau TCP ca offset
in cadrul campului data din structura sb relativ la header-ul IP;
pentru mai multe detalii poti sa consulti Linux Device Drivers 3rd
Edition, capitolul 17 sau linkul urmator:
http://uqconnect.net/~zzoklan/documents/netfilter.html
Razvan
---
Detalii despre listele noastre de mail: http://www.lug.ro/