summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index 00217be..d13ae74 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1574,10 +1574,11 @@ unsigned
NetCksum(uchar * ptr, int len)
{
ulong xsum;
+ ushort *p = ptr;
xsum = 0;
while (len-- > 0)
- xsum += *((ushort *)ptr)++;
+ xsum += *p++;
xsum = (xsum & 0xffff) + (xsum >> 16);
xsum = (xsum & 0xffff) + (xsum >> 16);
return (xsum & 0xffff);