[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Question about skbuff



Hi

Still, there's something wrong with your code. On 2 linux boxes I checked
file
>#include <net/ip.h> //IPPROTO_TCP, IPPROTO_UDP
doesn't exist. The 2 macros above are defined in <netinet/in.h> and
<linux/in.h>. I am not sure, But I think you should include <linux/...> in
a module, am I right? Next, as has already been pointed out,
>    struct tcphdr * tcph = (void *) ip + ip->ihl *4;
is wrong. You shouldn't use void * in arithmetic. Did you mean smth like
(void *) (ip + ip->ihl *4);
? (not knowing anything about those particular types and structs). Also,
you don't need to #include same header-files multiple times.

Guennadi
___

Dr. Guennadi V. Liakhovetski
Department of Applied Mathematics
University of Sheffield, Sheffield, U.K.
email: g.liakhovetski@sheffield.ac.uk


-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/