From e4762f75c347f9a410f7a1c5d4bd50e0c59df885 Mon Sep 17 00:00:00 2001 From: "George V. Neville-Neil" Date: Fri, 29 Aug 2008 20:42:58 +0000 Subject: [PATCH] Fix a bug whereby multicast packets that are looped back locally wind up with the incorrect checksum on the wire when transmitted via devices that do checksum offloading. PR: kern/119635 Reviewed by: rwatson MFC after: 5 days --- sys/netinet/ip_output.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 88e18a1a18d5..4567f05114da 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1146,7 +1146,11 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, register struct ip *ip; struct mbuf *copym; - copym = m_copy(m, 0, M_COPYALL); + /* + * Make a deep copy of the packet because we're going to + * modify the pack in order to generate checksums. + */ + copym = m_dup(m, M_DONTWAIT); if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) {