aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/lib/bpf/xsk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
index bf15a80a37c2..b33740221b7e 100644
--- a/tools/lib/bpf/xsk.c
+++ b/tools/lib/bpf/xsk.c
@@ -327,7 +327,8 @@ static int xsk_get_max_queues(struct xsk_socket *xsk)
327 327
328 channels.cmd = ETHTOOL_GCHANNELS; 328 channels.cmd = ETHTOOL_GCHANNELS;
329 ifr.ifr_data = (void *)&channels; 329 ifr.ifr_data = (void *)&channels;
330 strncpy(ifr.ifr_name, xsk->ifname, IFNAMSIZ); 330 strncpy(ifr.ifr_name, xsk->ifname, IFNAMSIZ - 1);
331 ifr.ifr_name[IFNAMSIZ - 1] = '\0';
331 err = ioctl(fd, SIOCETHTOOL, &ifr); 332 err = ioctl(fd, SIOCETHTOOL, &ifr);
332 if (err && errno != EOPNOTSUPP) { 333 if (err && errno != EOPNOTSUPP) {
333 ret = -errno; 334 ret = -errno;