Clean up unused CSUM_FRAGMENT.

Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2014-09-03 08:30:18 +00:00
parent b1f8b58696
commit bf7dcda366
5 changed files with 4 additions and 8 deletions

View File

@ -1501,7 +1501,7 @@ vlan_capabilities(struct ifvlan *ifv)
p->if_capenable & IFCAP_VLAN_HWTAGGING) {
ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM;
ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP |
CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT);
CSUM_UDP | CSUM_SCTP);
} else {
ifp->if_capenable = 0;
ifp->if_hwassist = 0;

View File

@ -523,8 +523,7 @@ ip_fastforward(struct mbuf *m)
else
mtu = ifp->if_mtu;
if (ip_len <= mtu ||
(ifp->if_hwassist & CSUM_FRAGMENT && (ip_off & IP_DF) == 0)) {
if (ip_len <= mtu) {
/*
* Avoid confusing lower layers.
*/

View File

@ -624,8 +624,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
* care of the fragmentation for us, we can just send directly.
*/
if (ip_len <= mtu ||
(m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 ||
((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) {
(m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0) {
ip->ip_sum = 0;
if (m->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) {
ip->ip_sum = in_cksum(m, hlen);

View File

@ -5332,8 +5332,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
* care of the fragmentation for us, we can just send directly.
*/
if (ip_len <= ifp->if_mtu ||
(m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 ||
((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) {
(m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0) {
ip->ip_sum = 0;
if (m0->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) {
ip->ip_sum = in_cksum(m0, ip->ip_hl << 2);

View File

@ -445,7 +445,6 @@ void sf_ext_free(void *, void *);
#define CSUM_UDP_IPV6 CSUM_IP6_UDP
#define CSUM_TCP_IPV6 CSUM_IP6_TCP
#define CSUM_SCTP_IPV6 CSUM_IP6_SCTP
#define CSUM_FRAGMENT 0x0 /* Unused */
/*
* mbuf types describing the content of the mbuf (including external storage).