Skip to content

Commit

Permalink
- delete mtags when we drop the M_PKTHDR flag by hand ('by hand' mean…
Browse files Browse the repository at this point in the history
…s not

  using M_MOVE_PKTHDR).
  such an operation should be avoided whenever it is possible...
  • Loading branch information
keiichi committed Feb 19, 2003
1 parent c1df78c commit aaea6e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion kame/sys/net/if_hif.c
@@ -1,4 +1,4 @@
/* $KAME: if_hif.c,v 1.42 2003/02/13 15:15:42 keiichi Exp $ */
/* $KAME: if_hif.c,v 1.43 2003/02/19 07:21:31 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -1080,6 +1080,9 @@ hif_output(ifp, m, dst, rt)
n->m_len = maxlen;
n->m_next = m;
m->m_flags &= ~M_PKTHDR;
#if defined(__OpenBSD__) || defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD__ < 5)
m_tag_delete_chain(m, NULL);
#endif
}
m = n;
}
Expand Down
5 changes: 4 additions & 1 deletion kame/sys/netinet6/esp_input.c
@@ -1,4 +1,4 @@
/* $KAME: esp_input.c,v 1.77 2003/02/07 10:17:08 suz Exp $ */
/* $KAME: esp_input.c,v 1.78 2003/02/19 07:21:31 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -977,6 +977,9 @@ esp6_input(mp, offp, proto)
n->m_next = m;
m_adj(m, maxlen);
m->m_flags &= ~M_PKTHDR;
#if defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD__ < 5)
m_tag_delete_chain(m, NULL);
#endif
}
m = n;
}
Expand Down
3 changes: 2 additions & 1 deletion netbsd/sys/net/if_loop.c
Expand Up @@ -230,7 +230,7 @@ looutput(ifp, m, dst, rt)
MGETHDR(n, M_DONTWAIT, MT_HEADER);
maxlen = MHLEN;
if (n)
M_MOVE_PKTHDR(n, m);
M_COPY_PKTHDR(n, m);
if (n && m->m_pkthdr.len > maxlen) {
MCLGET(n, M_DONTWAIT);
maxlen = MCLBYTES;
Expand All @@ -256,6 +256,7 @@ looutput(ifp, m, dst, rt)
n->m_len = maxlen;
n->m_next = m;
m->m_flags &= ~M_PKTHDR;
m_tag_delete_chain(m, NULL);
}
m = n;
}
Expand Down

0 comments on commit aaea6e3

Please sign in to comment.