diff options
| author | Sam Leffler <sam@FreeBSD.org> | 2002-12-30 20:22:40 +0000 |
|---|---|---|
| committer | Sam Leffler <sam@FreeBSD.org> | 2002-12-30 20:22:40 +0000 |
| commit | 9967cafc49317bb9dc73646958d2f9ef9cadb227 (patch) | |
| tree | 984c2041a8941be016b4cab972816b51adcc818d /sys/netinet/ip_input.c | |
| parent | 28788ed563b1b18d3c44a5df029deccba0393998 (diff) | |
Notes
Diffstat (limited to 'sys/netinet/ip_input.c')
| -rw-r--r-- | sys/netinet/ip_input.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 90f54e0c9230..51332a5eee99 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1763,8 +1763,17 @@ ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop) * data in a cluster may change before we reach icmp_error(). */ MGET(mcopy, M_DONTWAIT, m->m_type); + if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_DONTWAIT)) { + /* + * It's probably ok if the pkthdr dup fails (because + * the deep copy of the tag chain failed), but for now + * be conservative and just discard the copy since + * code below may some day want the tags. + */ + m_free(mcopy); + mcopy = NULL; + } if (mcopy != NULL) { - M_COPY_PKTHDR(mcopy, m); mcopy->m_len = imin((ip->ip_hl << 2) + 8, (int)ip->ip_len); m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t)); |
