diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 07:13:04 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 07:13:04 +0000 |
commit | 4f628d9625946295dcd5a970fb77c627c3da8cda (patch) | |
tree | 85e00a714fd4f945d587acc32134b9889b937cb4 /sys | |
parent | 123837d4fbadfd72ae7ebe28512722c13adc1be5 (diff) |
Only use IP checksumming if the output interface is not in bridge
mode. We can't deal with that well.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_output.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index daff4f58fef..bf395467286 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.110 2001/06/23 07:03:27 angelos Exp $ */ +/* $OpenBSD: ip_output.c,v 1.111 2001/06/23 07:13:03 angelos Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -632,7 +632,8 @@ sendit: if ((u_int16_t)ip->ip_len <= ifp->if_mtu) { ip->ip_len = htons((u_int16_t)ip->ip_len); ip->ip_off = htons((u_int16_t)ip->ip_off); - if (ifp->if_capabilities & IFCAP_CSUM_IPv4) { + if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) && + ifp->if_bridge == NULL) { m->m_pkthdr.csum |= M_IPV4_CSUM_OUT; ipstat.ips_outhwcsum++; } else { @@ -716,9 +717,11 @@ sendit: m->m_pkthdr.len = mhlen + len; m->m_pkthdr.rcvif = (struct ifnet *)0; mhip->ip_off = htons((u_int16_t)mhip->ip_off); - if (ifp->if_capabilities & IFCAP_CSUM_IPv4) + if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) && + ifp->if_bridge == NULL) { m->m_pkthdr.csum |= M_IPV4_CSUM_OUT; - else { + ipstat.ips_outhwcsum++; + } else { mhip->ip_sum = 0; mhip->ip_sum = in_cksum(m, mhlen); } @@ -733,9 +736,11 @@ sendit: m->m_pkthdr.len = hlen + firstlen; ip->ip_len = htons((u_int16_t)m->m_pkthdr.len); ip->ip_off = htons((u_int16_t)(ip->ip_off | IP_MF)); - if (ifp->if_capabilities & IFCAP_CSUM_IPv4) + if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) && + ifp->if_bridge == NULL) { m->m_pkthdr.csum |= M_IPV4_CSUM_OUT; - else { + ipstat.ips_outhwcsum++; + } else { ip->ip_sum = 0; ip->ip_sum = in_cksum(m, hlen); } |