git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5: check Tx queue size overflow
[dpdk.git]
/
drivers
/
net
/
pcap
/
rte_eth_pcap.c
diff --git
a/drivers/net/pcap/rte_eth_pcap.c
b/drivers/net/pcap/rte_eth_pcap.c
index
9fd9327
..
353538f
100644
(file)
--- a/
drivers/net/pcap/rte_eth_pcap.c
+++ b/
drivers/net/pcap/rte_eth_pcap.c
@@
-11,7
+11,7
@@
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <unistd.h>
-#if defined(RTE_EXEC_ENV_
BSDAPP
)
+#if defined(RTE_EXEC_ENV_
FREEBSD
)
#include <sys/sysctl.h>
#include <net/if_dl.h>
#endif
#include <sys/sysctl.h>
#include <net/if_dl.h>
#endif
@@
-979,7
+979,7
@@
static int
eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
const unsigned int numa_node)
{
eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
const unsigned int numa_node)
{
-#if defined(RTE_EXEC_ENV_LINUX
APP
)
+#if defined(RTE_EXEC_ENV_LINUX)
void *mac_addrs;
struct ifreq ifr;
int if_fd = socket(AF_INET, SOCK_DGRAM, 0);
void *mac_addrs;
struct ifreq ifr;
int if_fd = socket(AF_INET, SOCK_DGRAM, 0);
@@
-1008,7
+1008,7
@@
eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
return 0;
return 0;
-#elif defined(RTE_EXEC_ENV_
BSDAPP
)
+#elif defined(RTE_EXEC_ENV_
FREEBSD
)
void *mac_addrs;
struct if_msghdr *ifm;
struct sockaddr_dl *sdl;
void *mac_addrs;
struct if_msghdr *ifm;
struct sockaddr_dl *sdl;
@@
-1084,8
+1084,8
@@
eth_from_pcaps_common(struct rte_vdev_device *vdev,
struct devargs_queue *queue = &rx_queues->queue[i];
pp->rx_pcap[i] = queue->pcap;
struct devargs_queue *queue = &rx_queues->queue[i];
pp->rx_pcap[i] = queue->pcap;
- s
nprintf(rx->name, sizeof(rx->name), "%s", queue->name
);
- s
nprintf(rx->type, sizeof(rx->type), "%s", queue->type
);
+ s
trlcpy(rx->name, queue->name, sizeof(rx->name)
);
+ s
trlcpy(rx->type, queue->type, sizeof(rx->type)
);
}
for (i = 0; i < nb_tx_queues; i++) {
}
for (i = 0; i < nb_tx_queues; i++) {
@@
-1094,8
+1094,8
@@
eth_from_pcaps_common(struct rte_vdev_device *vdev,
pp->tx_dumper[i] = queue->dumper;
pp->tx_pcap[i] = queue->pcap;
pp->tx_dumper[i] = queue->dumper;
pp->tx_pcap[i] = queue->pcap;
- s
nprintf(tx->name, sizeof(tx->name), "%s", queue->name
);
- s
nprintf(tx->type, sizeof(tx->type), "%s", queue->type
);
+ s
trlcpy(tx->name, queue->name, sizeof(tx->name)
);
+ s
trlcpy(tx->type, queue->type, sizeof(tx->type)
);
}
return 0;
}
return 0;
@@
-1258,7
+1258,8
@@
create_eth:
if (pp == NULL) {
PMD_LOG(ERR,
"Failed to allocate memory for process private");
if (pp == NULL) {
PMD_LOG(ERR,
"Failed to allocate memory for process private");
- return -1;
+ ret = -1;
+ goto free_kvlist;
}
eth_dev->dev_ops = &ops;
}
eth_dev->dev_ops = &ops;
@@
-1281,7
+1282,7
@@
create_eth:
eth_dev->tx_pkt_burst = eth_pcap_tx;
rte_eth_dev_probing_finish(eth_dev);
eth_dev->tx_pkt_burst = eth_pcap_tx;
rte_eth_dev_probing_finish(eth_dev);
-
return 0
;
+
goto free_kvlist
;
}
ret = eth_from_pcaps(dev, &pcaps, pcaps.num_of_queue, &dumpers,
}
ret = eth_from_pcaps(dev, &pcaps, pcaps.num_of_queue, &dumpers,