summaryrefslogtreecommitdiffstats
path: root/sys/dev/mxge/if_mxge.c
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2013-02-22 16:46:28 +0000
committergallatin <gallatin@FreeBSD.org>2013-02-22 16:46:28 +0000
commit7ccd047ba12a0777f6d1b0eb4a0eed1c756faf7f (patch)
tree2771b765dbedff76216b71e9d88524434b4d8363 /sys/dev/mxge/if_mxge.c
parent0824737338d14dcd8942146e60f363daedad4cd2 (diff)
downloadFreeBSD-src-7ccd047ba12a0777f6d1b0eb4a0eed1c756faf7f.zip
FreeBSD-src-7ccd047ba12a0777f6d1b0eb4a0eed1c756faf7f.tar.gz
Try harder to make mxge safe for all combinations of INET and INET6
- Re-fix build by restoring local removed in r247151, but protected by #if defined(INET) || defined(INET6) so that the compile succeeds in the !(INET||INET6) case. - Protect call to in_pseudo() with an #ifdef INET, to allow a kernel to link with mxge when INET is not compiled in. - Also remove an errant (improperly commented) obsolete debugging printf Thanks to Glebius for pointing out the !(INET||INET6) build issue. Sponsored by: Myricom MFC After: 7 days
Diffstat (limited to 'sys/dev/mxge/if_mxge.c')
-rw-r--r--sys/dev/mxge/if_mxge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index afa27ff..ee2ca2f 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -1887,11 +1887,13 @@ mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
IPPROTO_TCP, 0);
#endif
} else {
+#ifdef INET
m->m_pkthdr.csum_flags |= CSUM_TCP;
sum = in_pseudo(pi->ip->ip_src.s_addr,
pi->ip->ip_dst.s_addr,
htons(IPPROTO_TCP + (m->m_pkthdr.len -
cksum_offset)));
+#endif
}
m_copyback(m, offsetof(struct tcphdr, th_sum) +
cksum_offset, sizeof(sum), (caddr_t)&sum);
@@ -2538,8 +2540,6 @@ mxge_rx_csum6(void *p, struct mbuf *m, uint32_t csum)
csum = (csum >> 16) + (csum & 0xFFFF);
c = in6_cksum_pseudo(ip6, m->m_pkthdr.len - cksum_offset, nxt,
csum);
-
-// printf("%d %d %x %x %x %x %x\n", m->m_pkthdr.len, cksum_offset, c, csum, ocsum, partial, d);
c ^= 0xffff;
return (c);
}
@@ -2560,6 +2560,9 @@ mxge_rx_csum(struct mbuf *m, int csum)
#ifdef INET
struct ip *ip;
#endif
+#if defined(INET) || defined(INET6)
+ int cap = m->m_pkthdr.rcvif->if_capenable;
+#endif
uint16_t c, etype;
OpenPOWER on IntegriCloud