diff options
author | 2016-09-12 17:15:53 +0000 | |
---|---|---|
committer | 2016-09-12 17:15:53 +0000 | |
commit | be6b951b58e37adb5c8ee38b11c32b5e6a93f5b3 (patch) | |
tree | 007cbfb3df0e6fb747d8207ba3bd6ea1685dc227 | |
parent | bpf_tap() is long dead! Long live bpf_mtap() & friends. (diff) | |
download | wireguard-openbsd-be6b951b58e37adb5c8ee38b11c32b5e6a93f5b3.tar.xz wireguard-openbsd-be6b951b58e37adb5c8ee38b11c32b5e6a93f5b3.zip |
Skip empty mbuf fragments like bus_dmamap_load_mbuf does
-rw-r--r-- | sys/dev/pv/if_xnf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index ccc5b57c407..eb114fd27d2 100644 --- a/sys/dev/pv/if_xnf.c +++ b/sys/dev/pv/if_xnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xnf.c,v 1.34 2016/08/29 17:35:25 mikeb Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.35 2016/09/12 17:15:53 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -513,7 +513,7 @@ chainlen(struct mbuf *m_head) struct mbuf *m; int n = 0; - for (m = m_head; m != NULL; m = m->m_next) + for (m = m_head; m != NULL && m->m_len > 0; m = m->m_next) n++; return (n); } @@ -533,7 +533,7 @@ xnf_encap(struct xnf_softc *sc, struct mbuf *m_head, uint32_t *prod) m_defrag(m_head, M_DONTWAIT)) goto errout; - for (m = m_head; m != NULL; m = m->m_next) { + for (m = m_head; m != NULL && m->m_len > 0; m = m->m_next) { i = *prod & (XNF_TX_DESC - 1); dmap = sc->sc_tx_dmap[i]; txd = &txr->txr_desc[i]; |