Problem with ip_fast_csum

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

 



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


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux