udev: link-config - use zero instead of memset

This commit is contained in:
Tom Gundersen 2013-10-29 16:10:54 +01:00
parent 55428d84f3
commit 2a7e74e002
1 changed files with 6 additions and 4 deletions

View File

@ -73,9 +73,10 @@ int ethtool_set_speed(int fd, const char *ifname, unsigned int speed, Duplex dup
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;
@ -125,9 +126,10 @@ int ethtool_set_wol(int fd, const char *ifname, WakeOnLan wol) {
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;