From 1a8ac98fc300bb326db6c311e2ccad071279296a Mon Sep 17 00:00:00 2001 From: fenner Date: Sat, 5 Jan 2002 18:23:53 +0000 Subject: [PATCH] Pre-calculate the checksum for multicast packets sourced on a multicast router. This is overkill; it should be possible to delay to hardware interfaces and only pre-calculate when forwarding to a tunnel. --- sys/netinet/ip_output.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 3e1ddb7a2b98..6185db0f0705 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -325,6 +325,18 @@ ip_output(m0, opt, ro, flags, imo) ip->ip_src = IA_SIN(ia)->sin_addr; } + if (ip_mrouter && (flags & IP_FORWARDING) == 0) { + /* + * 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; + } + } IN_LOOKUP_MULTI(pkt_dst, ifp, inm); if (inm != NULL && (imo == NULL || imo->imo_multicast_loop)) {