summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-09 17:17:13 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-09 17:17:13 +0000
commitb6c9fa8d054a7b340da8a2adea6661c713867ab0 (patch)
tree781375b41016884f31126505c1696e4c3ffabe91 /sys/dev/ic
parent2176b0436effe7c3206600a2226146c9a0189832 (diff)
Calculating the IP header checksum on Realtek 8168 is broken if the
packet has IP options. Disable IP checksum offloading for the affected revisions. From FreeBSD; OK sthen@ brad@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/re.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index 877fb08079c..39f824e609b 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.139 2012/05/09 13:30:12 jsg Exp $ */
+/* $OpenBSD: re.c,v 1.140 2013/03/09 17:17:12 bluhm Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1139,8 +1139,21 @@ re_attach(struct rl_softc *sc, const char *intrstr)
m_clsetwms(ifp, MCLBYTES, 2, RL_RX_DESC_CNT);
- ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
- IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
+ /*
+ * RTL8168/8111C generates wrong IP checksummed frame if the
+ * packet has IP options so disable TX IP checksum offloading.
+ */
+ switch (sc->sc_hwrev) {
+ case RL_HWREV_8168C:
+ case RL_HWREV_8168C_SPIN2:
+ case RL_HWREV_8168CP:
+ ifp->if_capabilities = IFCAP_VLAN_MTU |
+ IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
+ break;
+ default:
+ ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
+ IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
+ }
#if NVLAN > 0
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;