diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-15 02:54:18 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-15 02:54:18 +0000 |
commit | ca6e31dba9e1bc2b996fa3a4667177917f3468be (patch) | |
tree | 2f0c42f6b5bb6b1401e6bb071096444c5ec4810b /sys/net | |
parent | cee03e85621bb0886bf3f7dcec324b3af6e07f82 (diff) |
replace m_copym2 with m_dup_pkt for the dup-to handling.
note that this uses max_linkhdr as the adjustment arg. this follows
what the ip stack does when generating packets as it provides space
for link headers (like ethernet headers) to be prepended on the new
packet.
ok henning@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 7df8e3aa12f..b791f0b0b4a 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.968 2016/04/07 14:28:16 mpi Exp $ */ +/* $OpenBSD: pf.c,v 1.969 2016/04/15 02:54:17 dlg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -5517,7 +5517,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_copym2(*m, 0, M_COPYALL, M_NOWAIT)) == NULL) + if ((m0 = m_dup_pkt(*m, max_linkhdr, M_NOWAIT)) == NULL) return; } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) @@ -5676,7 +5676,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, } if (r->rt == PF_DUPTO) { - if ((m0 = m_copym2(*m, 0, M_COPYALL, M_NOWAIT)) == NULL) + if ((m0 = m_dup_pkt(*m, max_linkhdr, M_NOWAIT)) == NULL) return; } else { if ((r->rt == PF_REPLYTO) == (r->direction == dir)) |