Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2001 20:42:37 -0800
From:      Bill Fenner <fenner@research.att.com>
To:        freebsd@hoolan.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: UDP checksum error after encapsulating multicast packet
Message-ID:  <200112070442.UAA08096@windsor.research.att.com>

next in thread | raw e-mail | index | archive | help

--19701020
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline


I looked at the larger context and realized that ip_mloopback()
was wrong too.  Try this updated patch; it is a superset of the
previous one.

  Bill


--19701020
Content-Type: text/plain; name="ip_output.c.diff"; x-unix-mode=0644
Content-Disposition: attachment; filename="ip_output.c.diff"

Index: ip_output.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.143
diff -u -r1.143 ip_output.c
--- ip_output.c	1 Dec 2001 13:48:16 -0000	1.143
+++ ip_output.c	7 Dec 2001 04:37:33 -0000
@@ -353,6 +363,16 @@
 				 */
 				if (!rsvp_on)
 				  imo = NULL;
+				/*
+				 * XXX
+				 * delayed checksums are not currently
+				 * compatible with IP multicast routing
+				 */
+				if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+					in_delayed_cksum(m);
+					m->m_pkthdr.csum_flags &=
+						~CSUM_DELAY_DATA;
+				}
 				if (ip_mforward(ip, ifp, m, imo) != 0) {
 					m_freem(m);
 					goto done;
@@ -1906,6 +2358,17 @@
 	register struct ip *ip;
 	struct mbuf *copym;
 
+	/*
+	 * XXX
+	 * delayed checksums are not currently
+	 * compatible with IP multicast routing.
+	 * Can't do this on copym because it may
+	 * be shared.
+	 */
+	if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+		in_delayed_cksum(m);
+		m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
+	}
 	copym = m_copy(m, 0, M_COPYALL);
 	if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
 		copym = m_pullup(copym, hlen);
@@ -1946,12 +2409,6 @@
 		copym->m_pkthdr.rcvif = ifp;
 		ip_input(copym);
 #else
-		/* if the checksum hasn't been computed, mark it as valid */
-		if (copym->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
-			copym->m_pkthdr.csum_flags |=
-			    CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
-			copym->m_pkthdr.csum_data = 0xffff;
-		}
 		if_simloop(ifp, copym, dst->sin_family, 0);
 #endif
 	}

--19701020--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112070442.UAA08096>