p2pd: fix recomputeIPv4HeaderChecksum function
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 23 Apr 2014 12:39:33 +0000 (14:39 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 23 Apr 2014 12:41:54 +0000 (14:41 +0200)
There was a missing htons when putting the recomputed checksum
into the IP header

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/p2pd/src/p2pd.c

index 44abcfe..6e3f98c 100644 (file)
@@ -641,7 +641,7 @@ static void recomputeIPv4HeaderChecksum(struct ip *header) {
   /* step 3 */
   sum = ~sum & 0xffff;
 
-  header->ip_sum = (u_short) (sum);
+  header->ip_sum = htons((u_short)sum);
 }
 
 /* -------------------------------------------------------------------------