X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=98c63167665fd2cd7aad824f9266adbdc1d40f58;hb=28b7a53b693f6b4e70218a926e68a36ece54cda1;hp=a8ddd04f8d8c6b2e4c72aaddb24b15f1ffb1d209;hpb=0912276c6467aa3ee6f570b31245367319da572a;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index a8ddd04f..98c63167 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -2,7 +2,7 @@ device.c -- Interaction with Solaris tun device Copyright (C) 2001-2005 Ivo Timmermans, 2002-2010 OpenVPN Technologies, Inc. - 2001-2014 Guus Sliepen + 2001-2022 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -160,7 +160,8 @@ static bool setup_device(void) { { /* Remove muxes just in case they are left over from a crashed tincd */ - struct lifreq ifr = {}; + struct lifreq ifr; + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.lifr_name, iface, sizeof(ifr.lifr_name)); if(ioctl(ip_fd, SIOCGLIFMUXID, &ifr) >= 0) { @@ -182,7 +183,8 @@ static bool setup_device(void) { int arp_fd = -1; if(device_type == DEVICE_TYPE_TAP) { - struct lifreq ifr = {}; + struct lifreq ifr; + memset(&ifr, 0, sizeof(ifr)); if(ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not set flags on %s %s!", device_info, device); @@ -263,7 +265,9 @@ static bool setup_device(void) { close(arp_fd); } - struct lifreq ifr = {}; + struct lifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.lifr_name, iface, sizeof(ifr.lifr_name)); @@ -297,7 +301,8 @@ static bool setup_device(void) { static void close_device(void) { if(iface) { - struct lifreq ifr = {}; + struct lifreq ifr; + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.lifr_name, iface, sizeof(ifr.lifr_name)); if(ioctl(ip_fd, SIOCGLIFMUXID, &ifr) >= 0) {