ip_check_sum problem

From: Norka Lucena (norka@ecs.syr.edu)
Date: Sun Mar 16 2003 - 18:31:00 EST


Hi,

I am having problems computing the IP checksum with the th ip_fast_csum.
I would REALLY appreciate if any of you can help me.

This is the function I am using to compute the IP checksum.

void computeIPChecksum(struct iphdr* ip) {
  printk("*** IP checksum (before) : %d\n", ip->check);
  
  ip->check = 0; /* it must be pre-zero'd */
  ip->check = ip_fast_csum((unsigned char *)ip, ip->ihl);

  printk("*** IP checksum (after) : %d\n", ip->check);
}
 
Please notice that because I am not modifying the packet at all yet, I
should
get the same result. Well, I don't. I have no clue why.
Any thoughts?

Please, reply directly to norka@ecs.syr.edu.
Thank you so much, in advance,

Norka

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:18 EST