| Summary: | rwhod does not see itself via xl0 | ||
|---|---|---|---|
| Product: | Base System | Reporter: | marcolz <marcolz> |
| Component: | kern | Assignee: | Bill Fenner <fenner> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.4-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
marcolz
2001-11-13 17:30:01 UTC
What if you turn off hardware checksums? Bill >
> What if you turn off hardware checksums?
How ?
I did try setting net.inet.udp.checksum to 0, but that did not have any
effect.
Marc
It turns out that when a broadcast packet is looped back, the checksums
are checked on the way in even if they were not calculated on the
way out. This patch works for me; would you mind trying it?
Thanks,
Bill
cvs diff: Diffing .
Index: if_ethersubr.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_ethersubr.c,v
retrieving revision 1.70.2.19
diff -u -r1.70.2.19 if_ethersubr.c
--- if_ethersubr.c 2001/11/04 22:32:16 1.70.2.19
+++ if_ethersubr.c 2001/12/04 03:15:34
@@ -331,12 +331,25 @@
* reasons and compatibility with the original behavior.
*/
if ((ifp->if_flags & IFF_SIMPLEX) && (loop_copy != -1)) {
+ int csum_flags = 0;
+
+ if (m->m_pkthdr.csum_flags & CSUM_IP)
+ csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID);
+ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA)
+ csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR);
if ((m->m_flags & M_BCAST) || (loop_copy > 0)) {
struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
+ n->m_pkthdr.csum_flags |= csum_flags;
+ if (csum_flags & CSUM_DATA_VALID)
+ n->m_pkthdr.csum_data = 0xffff;
+
(void) if_simloop(ifp, n, dst->sa_family, hlen);
} else if (bcmp(eh->ether_dhost,
eh->ether_shost, ETHER_ADDR_LEN) == 0) {
+ m->m_pkthdr.csum_flags |= csum_flags;
+ if (csum_flags & CSUM_DATA_VALID)
+ m->m_pkthdr.csum_data = 0xffff;
(void) if_simloop(ifp, m, dst->sa_family, hlen);
return (0); /* XXX */
}
I tested the patch and it works fine. I tested the patch and it works fine. Responsible Changed From-To: freebsd-bugs->fenner Bill asked for a feedback, and originator says patch worked OK. State Changed From-To: open->closed Patch committed to -current, will MFC before 4.5 if re@ approves |