sensitivity of packet range options fine tuning:
[obnox/wireshark/wip.git] / in_cksum.c
index ff07a0ad2c9cb435fa235fc554221c48f98f40aa..4bf224e6a98a7a26eee430c45b5db754cbff83c0 100644 (file)
@@ -2,7 +2,7 @@
  * 4.4-Lite-2 Internet checksum routine, modified to take a vector of
  * pointers/lengths giving the pieces to be checksummed.
  *
- * $Id: in_cksum.c,v 1.6 2002/07/21 20:31:21 guy Exp $
+ * $Id: in_cksum.c,v 1.9 2002/08/28 21:00:06 jmayer Exp $
  */
 
 /*
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
 #include <glib.h>
 
 #include "in_cksum.h"
@@ -97,7 +81,7 @@ in_cksum(const vec_t *vec, int veclen)
                         * of a word spanning between this chunk and the
                         * last chunk.
                         *
-                        * s_util.c[0] is already saved when scanning previous 
+                        * s_util.c[0] is already saved when scanning previous
                         * chunk.
                         */
                        s_util.c[1] = *(const guint8 *)w;
@@ -210,7 +194,7 @@ in_cksum_shouldbe(guint16 sum, guint16 computed_sum)
         * will be in host byte order, which is what we'll return.
         */
        shouldbe = sum;
-       shouldbe += ntohs(computed_sum);
+       shouldbe += g_ntohs(computed_sum);
        shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
        shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
        return shouldbe;