changeset 12993:2ec828581df0

6949982 Bad qfe hwcksum for IPv6 UDP packets sent with CIPSO option.
author Zeeshanul Huq - Sun Microsystems - Beijing China <Zeeshanul.Huq@Sun.COM>
date Mon, 02 Aug 2010 11:09:26 +0800
parents c2b4f6c2d38a
children a2d5e2db1c76
files usr/src/uts/common/io/hme/hme.c usr/src/uts/common/io/hme/hme_mac.h
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/hme/hme.c	Mon Aug 02 11:02:38 2010 +0800
+++ b/usr/src/uts/common/io/hme/hme.c	Mon Aug 02 11:09:26 2010 +0800
@@ -19,8 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 
@@ -2342,7 +2341,9 @@
 	}
 	mcopymsg(mp, tbuf->kaddr);
 
-	if ((csflags != 0) && (len < 64)) {
+	if ((csflags != 0) && ((len < 64) ||
+	    (start_offset > HMETMD_CSSTART_MAX) ||
+	    (stuff_offset > HMETMD_CSSTUFF_MAX))) {
 		uint16_t sum;
 		sum = hme_cksum(tbuf->kaddr + start_offset,
 		    len - start_offset);
--- a/usr/src/uts/common/io/hme/hme_mac.h	Mon Aug 02 11:02:38 2010 +0800
+++ b/usr/src/uts/common/io/hme/hme_mac.h	Mon Aug 02 11:09:26 2010 +0800
@@ -19,8 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #ifndef	HME_MAC_H
@@ -60,6 +59,8 @@
 					/* 0 - owned by software */
 					/* 1 - owned by hardware */
 
+#define	HMETMD_CSSTART_MAX	0x3f	/* Maximum checksum start offset */
+#define	HMETMD_CSSTUFF_MAX	0xff	/* Maximum checksum stuff offset */
 #define	HMETMD_CSSTART_SHIFT 14	/* checksum start bit position */
 #define	HMETMD_CSSTUFF_SHIFT 20	/* checksum stuff bit position */