+
+#ifdef TCP_CHECKSUM
+ {
+#define getip_hl(base) ((base).ip_hl)
+
+ u_short mytcpcksum (struct ip *pip);
+ struct tcphdr *ptcp;
+ struct ip *iphdr;
+ u_short thecksum;
+ u_long hlen;
+
+ iphdr = (struct ip*) (cp + PPP_HDRLEN);
+ hlen = getip_hl(*iphdr) << 2; /* Length is in words */
+ ptcp = (struct tcphdr *)&((u_char *)iphdr)[hlen];
+
+ thecksum = (u_short)mytcpcksum(iphdr);
+
+ if(ptcp->th_sum != thecksum)
+ {
+#ifdef NEWVJ_RESYNC
+ set_newvj_error_mode();
+#endif
+ IOLog("NEWVJ: Warning... TCP checksum failed Received=%u, Calculated=%u)\n",
+ (ptcp->th_sum)&0xffff, thecksum&0xffff);
+ }
+ }
+#endif
+
+