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
replace snprintf with strlcpy
[dpdk.git]
/
drivers
/
net
/
af_packet
/
rte_eth_af_packet.c
diff --git
a/drivers/net/af_packet/rte_eth_af_packet.c
b/drivers/net/af_packet/rte_eth_af_packet.c
index
264cfc0
..
99e13fe
100644
(file)
--- a/
drivers/net/af_packet/rte_eth_af_packet.c
+++ b/
drivers/net/af_packet/rte_eth_af_packet.c
@@
-6,6
+6,7
@@
* All rights reserved.
*/
* All rights reserved.
*/
+#include <rte_string_fns.h>
#include <rte_mbuf.h>
#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_mbuf.h>
#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
@@
-442,7
+443,7
@@
eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
if (s < 0)
return -EINVAL;
if (s < 0)
return -EINVAL;
- s
nprintf(ifr.ifr_name, IFNAMSIZ, "%s", internals->if_name
);
+ s
trlcpy(ifr.ifr_name, internals->if_name, IFNAMSIZ
);
ret = ioctl(s, SIOCSIFMTU, &ifr);
close(s);
ret = ioctl(s, SIOCSIFMTU, &ifr);
close(s);
@@
-462,7
+463,7
@@
eth_dev_change_flags(char *if_name, uint32_t flags, uint32_t mask)
if (s < 0)
return;
if (s < 0)
return;
- s
nprintf(ifr.ifr_name, IFNAMSIZ, "%s", if_name
);
+ s
trlcpy(ifr.ifr_name, if_name, IFNAMSIZ
);
if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0)
goto out;
ifr.ifr_flags &= mask;
if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0)
goto out;
ifr.ifr_flags &= mask;