summaryrefslogtreecommitdiffstats
path: root/sys/dev/ubsec/ubsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ubsec/ubsec.c')
-rw-r--r--sys/dev/ubsec/ubsec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c
index 37cb37e..b62a425 100644
--- a/sys/dev/ubsec/ubsec.c
+++ b/sys/dev/ubsec/ubsec.c
@@ -1269,6 +1269,10 @@ ubsec_process(void *arg, struct cryptop *crp, int hint)
if (q->q_src_m->m_flags & M_PKTHDR) {
len = MHLEN;
MGETHDR(m, M_DONTWAIT, MT_DATA);
+ if (m && !m_dup_pkthdr(m, q->q_src_m, M_DONTWAIT)) {
+ m_free(m);
+ m = NULL;
+ }
} else {
len = MLEN;
MGET(m, M_DONTWAIT, MT_DATA);
@@ -1278,8 +1282,6 @@ ubsec_process(void *arg, struct cryptop *crp, int hint)
err = sc->sc_nqueue ? ERESTART : ENOMEM;
goto errout;
}
- if (len == MHLEN)
- M_COPY_PKTHDR(m, q->q_src_m);
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
OpenPOWER on IntegriCloud