From 3fae25a8a605b8e9431642be3708a0da49be1b9b Mon Sep 17 00:00:00 2001 From: Archie Cobbs Date: Wed, 1 Dec 1999 23:11:58 +0000 Subject: [PATCH] Use m_dup() instead of m_copypacket() to duplicate the mbuf chain. This fixes a bug where if the original packet was modified downstream of the tee node, then the copy could get modified too. --- sys/netgraph/ng_tee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c index 2c5b9f36c57..575c8702c7a 100644 --- a/sys/netgraph/ng_tee.c +++ b/sys/netgraph/ng_tee.c @@ -260,7 +260,7 @@ ngt_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) meta_p meta2; /* Copy packet */ - m2 = m_copypacket(m, M_NOWAIT); + m2 = m_dup(m, M_NOWAIT); if (m2 == NULL) { NG_FREE_DATA(m, meta); return (ENOBUFS);