[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sk_buff checksum
sorry,
i'm sending the hook function, where i'm doing everything.
============
unsigned int hook_pool(unsigned int hooknum,
struct sk_buff **skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff*)){
struct tcphdr *tcp;
char *data;
struct sk_buff *sock_buff;
int i=0;
char *findGzip;
sock_buff=*skb;
tcp = (struct tcphdr *)(sock_buff->data + (sock_buff->nh.iph->ihl * 4));
data = (char *)((int)tcp + (int)(tcp->doff * 4));
if (findGzip=(strstr(data,"senol1763"))){
printk("%d Data CheckSum 1 = %u\n",hooknum,sock_buff->csum);
printk("%d TCP CheckSum 1 = %u\n",hooknum,sock_buff->h.th->check);
printk("%d IP CheckSum 1 = %u\n",hooknum,sock_buff->nh.iph->check);
printk("\n");
findGzip[1]='n';
/* here, i'm calculating ne csum.*/
sock_buff->h.th->check=0;
sock_buff->h.th->check=in_cksum_tcp(sock_buff->nh.iph->saddr,sock_buff->nh.iph->daddr,(unsigned
short *)sock_buff->h.th , sizeof(*sock_buff->h.th) );
}
return NF_ACCEPT;
}
==============
yes that's all what i'm doing.
as i write a csum calculation code (i'm not so sure) above, i've tried
so many csum calculations. but same fault i'm still in.
do i forget something, or doing something wrong?
thanks for your interest.
-
senol
On 3/8/06, Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
>
> > does anybody know about my problem? can you give me some advice
> > whether you have any solutions about it.
>
>
> somehow I doubt people can help you since you forgot to attach your
> source code (or put a URL to it in)
>
>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/