aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-03-27 23:54:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-03-27 23:55:43 +0200
commit46ba2468a3de85076ce92ce8e8cc7a086bac69f0 (patch)
treeae1a4ae876f126e9e158ee4e95f36462aeffbf1c /networking
parent98592db3231caa905e6d54129c621f3e8e9bbaa3 (diff)
downloadbusybox-46ba2468a3de85076ce92ce8e8cc7a086bac69f0.tar.gz
ioctl(SIOCGIFINDEX) does not require clearing of entire ifr
function old new delta INET6_setroute 492 472 -20 do_iplink 1357 1330 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-47) Total: -47 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/libiproute/iplink.c2
-rw-r--r--networking/route.c2
-rw-r--r--networking/udhcp/d6_socket.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 2aa8b683b..9c164a71d 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -161,7 +161,7 @@ static int get_address(char *dev, int *htype)
s = xsocket(PF_PACKET, SOCK_DGRAM, 0);
- memset(&ifr, 0, sizeof(ifr));
+ /*memset(&ifr, 0, sizeof(ifr)); - SIOCGIFINDEX does not need to clear all */
strncpy_IFNAMSIZ(ifr.ifr_name, dev);
xioctl(s, SIOCGIFINDEX, &ifr);
diff --git a/networking/route.c b/networking/route.c
index 6edc0f6d7..8387ce1bb 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -444,7 +444,7 @@ static NOINLINE void INET6_setroute(int action, char **args)
if (devname) {
struct ifreq ifr;
- memset(&ifr, 0, sizeof(ifr));
+ /*memset(&ifr, 0, sizeof(ifr)); - SIOCGIFINDEX does not need to clear all */
strncpy_IFNAMSIZ(ifr.ifr_name, devname);
xioctl(skfd, SIOCGIFINDEX, &ifr);
rt.rtmsg_ifindex = ifr.ifr_ifindex;
diff --git a/networking/udhcp/d6_socket.c b/networking/udhcp/d6_socket.c
index 315c8d98a..6ad53a9c2 100644
--- a/networking/udhcp/d6_socket.c
+++ b/networking/udhcp/d6_socket.c
@@ -63,7 +63,7 @@ int FAST_FUNC d6_read_interface(const char *interface, int *ifindex, struct in6_
struct ifreq ifr;
int fd;
- memset(&ifr, 0, sizeof(ifr));
+ /*memset(&ifr, 0, sizeof(ifr)); - SIOCGIFINDEX does not need to clear all */
strncpy_IFNAMSIZ(ifr.ifr_name, interface);
fd = xsocket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (ioctl(fd, SIOCGIFINDEX, &ifr) == 0) {