diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-05-25 13:32:54 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-05-25 13:32:54 +0000 |
commit | 44bf36969eebc4a2c0f076565468e7c9584ed3f2 (patch) | |
tree | d91961b5508e7bb2041254ef783311cb85fe5647 /sys/netipx | |
parent | 3e055e029877a757fd0ae8dad210d4a06904036c (diff) | |
download | FreeBSD-src-44bf36969eebc4a2c0f076565468e7c9584ed3f2.zip FreeBSD-src-44bf36969eebc4a2c0f076565468e7c9584ed3f2.tar.gz |
Eliminate use of dtom() in spx_output() by fixing up tracking of the
containing mbuf for 'si' in local variable 'm'.
MFC after: 1 month
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/spx_usrreq.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 10f84c1..3e8e81d 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -428,7 +428,7 @@ int spx_output(struct spxpcb *cb, struct mbuf *m0) { struct socket *so = cb->s_ipxpcb->ipxp_socket; - struct mbuf *m; + struct mbuf *m = NULL; struct spx *si = NULL; struct sockbuf *sb = &so->so_snd; int len = 0, win, rcv_win; @@ -678,6 +678,7 @@ send: * Find requested packet. */ si = NULL; + m = NULL; if (len > 0) { cb->s_want = cb->s_snxt; for (m = sb->sb_mb; m != NULL; m = m->m_nextpkt) { @@ -687,10 +688,12 @@ send: } found: if (si != NULL) { - if (si->si_seq == cb->s_snxt) - cb->s_snxt++; - else - spxstat.spxs_sndvoid++, si = NULL; + if (si->si_seq != cb->s_snxt) { + spxstat.spxs_sndvoid++; + si = NULL; + m = NULL; + } else + cb->s_snxt++; } } @@ -703,12 +706,12 @@ send: if (SSEQ_LT(alo, cb->s_alo)) alo = cb->s_alo; - if (si != NULL) { + if (m != NULL) { /* * Must make a copy of this packet for ipx_output to monkey * with. */ - m = m_copy(dtom(si), 0, (int)M_COPYALL); + m = m_copy(m, 0, M_COPYALL); if (m == NULL) return (ENOBUFS); si = mtod(m, struct spx *); |