[pso] [Tema4][Linux]NU incepeti tema inainte sa cititi ASTA
sorin gsmcreation
gsmcreation at yahoo.com
Sun May 20 18:16:31 EEST 2007
Salutare!
Dupa ceva timp am reusit sa descoperim (Razvan de
fapt) motivul comportarii ciudate a hook-ului de
input.
Problema era ca in acest hook, cand citeam portul
sursa si destinatie al oricarui pachet, fie el
TCP/UDP, valorile acestor porturi erau corupte.
Asta pentru ca nu obtineam ok pointerii catre
headerele tcp si udp (foloseam metoda initiala din
laboratorul de networking). Partea ciudata e ca in
hook-ul de output mergea sa obtinem headerele ca in
laborator; doar la input se comporta ciudat.
Solutia care merge este:
struct iphdr *iph = (*skb)->nh.iph;
struct tcphdr *tcph = (struct tcphdr *) ((*skb)->data
+ iph->ihl * 4);
struct udphdr *udph = (struct udphdr *) ((*skb)->data
+ iph->ihl * 4);
Mai multe gasiti aici:
http://www.topsight.net/article.php/2003050621055083/print
____________________________________________________________________________________Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
More information about the pso
mailing list