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

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
        }

Reply via email to