Mercurial > illumos > illumos-gate
changeset 11145:c1f49419a884
6898088 Wrongly set start and end values for partial checksum
6902567 Should not rely on partial checksum value when IP packet has options
author | Roamer <Roamer@Sun.COM> |
---|---|
date | Sat, 21 Nov 2009 01:05:40 -0800 |
parents | 7c4b3eec2d66 |
children | 7e58f40bcb1c |
files | usr/src/uts/common/inet/ip/ip_input.c usr/src/uts/common/io/xge/drv/xgell.c usr/src/uts/intel/ip/ip.global-objs.debug64 usr/src/uts/intel/ip/ip.global-objs.obj64 usr/src/uts/sparc/ip/ip.global-objs.debug64 usr/src/uts/sparc/ip/ip.global-objs.obj64 |
diffstat | 6 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/inet/ip/ip_input.c Fri Nov 20 17:40:56 2009 -0800 +++ b/usr/src/uts/common/inet/ip/ip_input.c Sat Nov 21 01:05:40 2009 -0800 @@ -1759,6 +1759,13 @@ /* Error has been sent and mp consumed */ return; } + /* + * Some old hardware does partial checksum by including the + * whole IP header, so the partial checksum value might have + * become invalid if any option in the packet have been + * updated. Always clear partial checksum flag here. + */ + DB_CKSUMFLAGS(mp) &= ~HCK_PARTIALCKSUM; } /* @@ -2139,9 +2146,6 @@ return (B_FALSE); } -/* There are drivers that can't do partial checksum with IP options */ -int eri_cksum_workaround = 1; - /* * Verify the ULP checksums. * Returns B_TRUE if ok, or if the ULP doesn't have a well-defined checksum @@ -2245,7 +2249,6 @@ if ((hck_flags & HCK_PARTIALCKSUM) && (mp1 == NULL || mp1->b_cont == NULL) && ip_hdr_length >= DB_CKSUMSTART(mp) && - (!eri_cksum_workaround || ip_hdr_length == IP_SIMPLE_HDR_LENGTH) && ((len = ip_hdr_length - DB_CKSUMSTART(mp)) & 1) == 0) { uint32_t adj; uchar_t *cksum_start;
--- a/usr/src/uts/common/io/xge/drv/xgell.c Fri Nov 20 17:40:56 2009 -0800 +++ b/usr/src/uts/common/io/xge/drv/xgell.c Sat Nov 21 01:05:40 2009 -0800 @@ -20,12 +20,12 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* - * Copyright (c) 2002-2008 Neterion, Inc. + * Copyright (c) 2002-2009 Neterion, Inc. * All right Reserved. * * FileName : xgell.c @@ -635,9 +635,9 @@ if (ext_info->proto & XGE_HAL_FRAME_PROTO_IPV4) { struct ip *ip = (struct ip *)(vaddr + ip_off); - start = ip->ip_hl * 4 + ip_off; + start = ip->ip_hl * 4; } else { - start = ip_off + 40; + start = 40; } cksum_flags |= HCK_PARTIALCKSUM; (void) hcksum_assoc(mp, NULL, NULL, start, 0,
--- a/usr/src/uts/intel/ip/ip.global-objs.debug64 Fri Nov 20 17:40:56 2009 -0800 +++ b/usr/src/uts/intel/ip/ip.global-objs.debug64 Sat Nov 21 01:05:40 2009 -0800 @@ -312,5 +312,4 @@ udpinfov4 udpinfov6 winit_arp -eri_cksum_workaround nxge_cksum_workaround
--- a/usr/src/uts/intel/ip/ip.global-objs.obj64 Fri Nov 20 17:40:56 2009 -0800 +++ b/usr/src/uts/intel/ip/ip.global-objs.obj64 Sat Nov 21 01:05:40 2009 -0800 @@ -309,5 +309,4 @@ udpinfov4 udpinfov6 winit_arp -eri_cksum_workaround nxge_cksum_workaround