aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/arp.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/arp.c')
-rw-r--r--toys/pending/arp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/pending/arp.c b/toys/pending/arp.c
index 831facb9..1153ebc1 100644
--- a/toys/pending/arp.c
+++ b/toys/pending/arp.c
@@ -175,7 +175,7 @@ static int set_entry(void)
flags = ATF_PERM | ATF_COM;
if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2));
req.arp_flags = flags;
- strncpy(req.arp_dev, TT.device, sizeof(TT.device));
+ strncpy(req.arp_dev, TT.device, sizeof(req.arp_dev));
xioctl(TT.sockfd, SIOCSARP, &req);
if (toys.optflags & FLAG_v) xprintf("Entry set for %s\n", toys.optargs[0]);
@@ -204,7 +204,7 @@ static int delete_entry(void)
flags = ATF_PERM;
if (toys.optargs[1]) check_flags(&flags, (toys.optargs+1));
req.arp_flags = flags;
- strncpy(req.arp_dev, TT.device, sizeof(TT.device));
+ strncpy(req.arp_dev, TT.device, sizeof(req.arp_dev));
xioctl(TT.sockfd, SIOCDARP, &req);
if (toys.optflags & FLAG_v) xprintf("Delete entry for %s\n", toys.optargs[0]);
@@ -301,6 +301,7 @@ void arp_main(void)
if (CFG_TOYBOX_FREE) {
free(host_ip);
+ free(buf);
xclose(fd);
}
}