svn commit: r342370 - stable/12/sys/dev/fxp
Mark Johnston
markj at FreeBSD.org
Sat Dec 22 19:44:07 UTC 2018
Author: markj
Date: Sat Dec 22 19:44:06 2018
New Revision: 342370
URL: https://svnweb.freebsd.org/changeset/base/342370
Log:
MFC r342214:
Remove a use of a negative array index from fxp(4).
Modified:
stable/12/sys/dev/fxp/if_fxp.c
stable/12/sys/dev/fxp/if_fxpreg.h
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/12/sys/dev/fxp/if_fxp.c Sat Dec 22 16:23:42 2018 (r342369)
+++ stable/12/sys/dev/fxp/if_fxp.c Sat Dec 22 19:44:06 2018 (r342370)
@@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
cbp->tbd_number = nseg;
/* Configure TSO. */
if (m->m_pkthdr.csum_flags & CSUM_TSO) {
- cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
+ cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
FXP_IPCB_IP_CHECKSUM_ENABLE |
Modified: stable/12/sys/dev/fxp/if_fxpreg.h
==============================================================================
--- stable/12/sys/dev/fxp/if_fxpreg.h Sat Dec 22 16:23:42 2018 (r342369)
+++ stable/12/sys/dev/fxp/if_fxpreg.h Sat Dec 22 19:44:06 2018 (r342370)
@@ -281,10 +281,15 @@ struct fxp_cb_tx {
uint16_t cb_status;
uint16_t cb_command;
uint32_t link_addr;
- uint32_t tbd_array_addr;
- uint16_t byte_count;
- uint8_t tx_threshold;
- uint8_t tbd_number;
+ union {
+ struct {
+ uint32_t tbd_array_addr;
+ uint16_t byte_count;
+ uint8_t tx_threshold;
+ uint8_t tbd_number;
+ };
+ struct fxp_tbd tbdtso;
+ };
/*
* The following structure isn't actually part of the TxCB,
More information about the svn-src-all
mailing list