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
This commit is contained in:
George V. Neville-Neil 2008-08-29 20:42:58 +00:00
parent 12dc95824b
commit e4762f75c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=182463

View File

@ -1146,7 +1146,11 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst,
register struct ip *ip; register struct ip *ip;
struct mbuf *copym; 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)) if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen))
copym = m_pullup(copym, hlen); copym = m_pullup(copym, hlen);
if (copym != NULL) { if (copym != NULL) {