From owner-freebsd-bugs Mon Dec 3 19:30: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 03BE437B419 for ; Mon, 3 Dec 2001 19:30:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fB43U1922166; Mon, 3 Dec 2001 19:30:01 -0800 (PST) (envelope-from gnats) Date: Mon, 3 Dec 2001 19:30:01 -0800 (PST) Message-Id: <200112040330.fB43U1922166@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bill Fenner Subject: Re: kern/31954: rwhod does not see itself via xl0 Reply-To: Bill Fenner Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/31954; it has been noted by GNATS. From: Bill Fenner To: freebsd-gnats-submit@freebsd.org, marcolz@ilse.nl Cc: jlemon@freebsd.org Subject: Re: kern/31954: rwhod does not see itself via xl0 Date: Mon, 3 Dec 2001 19:23:25 -0800 (PST) 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 */ } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message