diff options
-rw-r--r-- | networking/arp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/arp.c b/networking/arp.c index 9381eb53a..69a5816eb 100644 --- a/networking/arp.c +++ b/networking/arp.c | |||
@@ -178,7 +178,7 @@ static int arp_del(char **args) | |||
178 | if (flags == 0) | 178 | if (flags == 0) |
179 | flags = 3; | 179 | flags = 3; |
180 | 180 | ||
181 | strncpy(req.arp_dev, device, sizeof(req.arp_dev)); | 181 | strncpy_IFNAMSIZ(req.arp_dev, device); |
182 | 182 | ||
183 | err = -1; | 183 | err = -1; |
184 | 184 | ||
@@ -219,7 +219,7 @@ static void arp_getdevhw(char *ifname, struct sockaddr *sa) | |||
219 | struct ifreq ifr; | 219 | struct ifreq ifr; |
220 | const struct hwtype *xhw; | 220 | const struct hwtype *xhw; |
221 | 221 | ||
222 | strcpy(ifr.ifr_name, ifname); | 222 | strncpy_IFNAMSIZ(ifr.ifr_name, ifname); |
223 | ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr, | 223 | ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr, |
224 | "can't get HW-Address for '%s'", ifname); | 224 | "can't get HW-Address for '%s'", ifname); |
225 | if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) { | 225 | if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) { |
@@ -332,7 +332,7 @@ static int arp_set(char **args) | |||
332 | /* Fill in the remainder of the request. */ | 332 | /* Fill in the remainder of the request. */ |
333 | req.arp_flags = flags; | 333 | req.arp_flags = flags; |
334 | 334 | ||
335 | strncpy(req.arp_dev, device, sizeof(req.arp_dev)); | 335 | strncpy_IFNAMSIZ(req.arp_dev, device); |
336 | 336 | ||
337 | /* Call the kernel. */ | 337 | /* Call the kernel. */ |
338 | if (option_mask32 & ARP_OPT_v) | 338 | if (option_mask32 & ARP_OPT_v) |