aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/af_packet
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:11:03 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-07-03 15:13:07 +0100
commitbf7567fd2a5b0b28ab724046143c24561d38d015 (patch)
treed3fecf7bb6da55e6ee81f8d42110bd51c6e93631 /drivers/net/af_packet
parent7595afa4d30097c1177b69257118d8ad89a539be (diff)
New upstream version 17.05.1
Change-Id: I8a23679edd6c9c593ceebecf7d2bf1b489e14ccb Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/af_packet')
-rw-r--r--drivers/net/af_packet/rte_eth_af_packet.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 68de45c3..9ccb7af9 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -252,8 +252,11 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
/* kick-off transmits */
- if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1)
- num_tx = 0; /* error sending -- no packets transmitted */
+ if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1) {
+ /* error sending -- no packets transmitted */
+ num_tx = 0;
+ num_tx_bytes = 0;
+ }
pkt_q->framenum = framenum;
pkt_q->tx_pkts += num_tx;
@@ -625,6 +628,8 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
goto error_early;
}
(*internals)->if_name = strdup(pair->value);
+ if ((*internals)->if_name == NULL)
+ goto error_early;
(*internals)->if_index = ifr.ifr_ifindex;
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) == -1) {