summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_tee.c
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>1999-12-01 23:11:58 +0000
committerarchie <archie@FreeBSD.org>1999-12-01 23:11:58 +0000
commit25b8ac3c906c7b506288673276d586bc76d0c194 (patch)
tree3199466ace9f1744176948273be6776af54996e9 /sys/netgraph/ng_tee.c
parent22ba6790838bbc14a95a6711a1cf074c8acaeec3 (diff)
downloadFreeBSD-src-25b8ac3c906c7b506288673276d586bc76d0c194.zip
FreeBSD-src-25b8ac3c906c7b506288673276d586bc76d0c194.tar.gz
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.
Diffstat (limited to 'sys/netgraph/ng_tee.c')
-rw-r--r--sys/netgraph/ng_tee.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c
index 2c5b9f3..575c870 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);
OpenPOWER on IntegriCloud