From ea82d613ab1e2ef7481c74b87a5d783ff1d695b2 Mon Sep 17 00:00:00 2001 From: cgd Date: Thu, 30 May 1996 23:08:36 +0000 Subject: [PATCH] Fix from Matt Thomas to fix problem where packets like 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01 would be checksummed incorrectly: rather than adding two 32-bit quantities together to sum a quadword (which was losing a carry bit), add as four 16-bit quantities. --- sys/arch/alpha/alpha/in_cksum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/alpha/alpha/in_cksum.c b/sys/arch/alpha/alpha/in_cksum.c index 660b866da733..d31bf78431fe 100644 --- a/sys/arch/alpha/alpha/in_cksum.c +++ b/sys/arch/alpha/alpha/in_cksum.c @@ -1,4 +1,4 @@ -/* $NetBSD: in_cksum.c,v 1.2 1996/05/19 21:41:00 cgd Exp $ */ +/* $NetBSD: in_cksum.c,v 1.3 1996/05/30 23:08:36 cgd Exp $ */ /* * Copyright (c) 1988, 1992, 1993 @@ -54,7 +54,7 @@ #define REDUCE32 \ { \ q_util.q = sum; \ - sum = q_util.l[0] + q_util.l[1]; \ + sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ } #define REDUCE16 \ { \