summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorChristiano F. Haesbaert <haesbaert@cvs.openbsd.org>2011-12-29 12:10:53 +0000
committerChristiano F. Haesbaert <haesbaert@cvs.openbsd.org>2011-12-29 12:10:53 +0000
commit9a7af7ec309e1b8bc76d267187bcc3a827a20c9b (patch)
tree36ecc92a17f28dfbdcfe208054a34e9c12e17ea9 /sys/netinet
parent5efc5c9649e486bf8253e9dd1b4015f9735eae20 (diff)
Escape hardware-checksumming if interface is in a bridge, this is
already done for UDP/TCP/ICMP. This fixes a problem where checksumming would not be computed if you have a bridge with at least one interface with hardware checksumming and another without. Discussed with sthen@ and henning@, this is somewhat a temporary fix, we should not have these special bridge cases in ip_output, as Henning said, the bridge must behave. But for that to work we need to poke the bridge harder, this problem has been seen by at least two users at: http://marc.info/?l=openbsd-misc&m=132391433319512&w=2 http://marc.info/?l=openbsd-misc&m=132234363030132&w=2 I promised to work on a better diff :-). ok henning@ sthen@ mikeb@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_output.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 88760e6e361..2894f72bedf 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.224 2011/12/02 03:15:31 haesbaert Exp $ */
+/* $OpenBSD: ip_output.c,v 1.225 2011/12/29 12:10:52 haesbaert Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -746,7 +746,8 @@ sendit:
*/
if (ntohs(ip->ip_len) <= mtu) {
ip->ip_sum = 0;
- if ((ifp->if_capabilities & IFCAP_CSUM_IPv4)) {
+ if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
+ (ifp->if_bridge == NULL)) {
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
ipstat.ips_outhwcsum++;
} else
@@ -892,7 +893,8 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu)
mhip->ip_off = htons((u_int16_t)mhip->ip_off);
mhip->ip_sum = 0;
if ((ifp != NULL) &&
- (ifp->if_capabilities & IFCAP_CSUM_IPv4)) {
+ (ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
+ (ifp->if_bridge == NULL)) {
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
ipstat.ips_outhwcsum++;
} else
@@ -911,7 +913,8 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu)
ip->ip_off |= htons(IP_MF);
ip->ip_sum = 0;
if ((ifp != NULL) &&
- (ifp->if_capabilities & IFCAP_CSUM_IPv4)) {
+ (ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
+ (ifp->if_bridge == NULL)) {
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
ipstat.ips_outhwcsum++;
} else