{
struct ifreq ifr;
struct ethtool_cmd ecmd;
- bool need_update;
+ bool need_update = false;
int r;
if (speed == 0 && duplex == _DUP_INVALID)
return 0;
- memset(&ecmd, 0x00, sizeof(struct ethtool_cmd));
+ zero(ecmd);
ecmd.cmd = ETHTOOL_GSET;
- memset(&ifr, 0x00, sizeof(struct ifreq));
+
+ zero(ifr);
strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
ifr.ifr_data = (void *)&ecmd;
int ethtool_set_wol(int fd, const char *ifname, WakeOnLan wol) {
struct ifreq ifr;
struct ethtool_wolinfo ecmd;
- bool need_update;
+ bool need_update = false;
int r;
if (wol == _WOL_INVALID)
return 0;
- memset(&ecmd, 0x00, sizeof(struct ethtool_wolinfo));
+ zero(ecmd);
ecmd.cmd = ETHTOOL_GWOL;
- memset(&ifr, 0x00, sizeof(struct ifreq));
+
+ zero(ifr);
strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
ifr.ifr_data = (void *)&ecmd;