diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-07-05 18:16:31 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-07-05 18:16:31 +0200 |
commit | 589c302e0b1c662d8cc25846e861ea0f8eed89f4 (patch) | |
tree | 888982bba6111a881aaa58f06b1053b880173027 /system-linux.c | |
parent | 1f11f552cea9358bd17a4c37a597799f11c52600 (diff) |
zero-initialize the ifreq when setting interfaces up or down
Diffstat (limited to 'system-linux.c')
-rw-r--r-- | system-linux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c index c4d094d..24ea2e3 100644 --- a/system-linux.c +++ b/system-linux.c @@ -350,6 +350,8 @@ static int system_if_resolve(struct device *dev) static int system_if_flags(const char *ifname, unsigned add, unsigned rem) { struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ioctl(sock_ioctl, SIOCGIFFLAGS, &ifr); ifr.ifr_flags |= add; |