summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-10-29 16:10:54 +0100
committerTom Gundersen <teg@jklm.no>2013-10-29 16:12:12 +0100
commit2a7e74e002d0df6d7021240d3310220bd19aa3fe (patch)
treefc94e3b8f7622aa14b049d0f7bac7b0abb077436
parent55428d84f31b52da1c50b7469f14e15740547f20 (diff)
udev: link-config - use zero instead of memset
-rw-r--r--src/udev/net/ethtool-util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
index 4fad52b469..68ddd25a90 100644
--- a/src/udev/net/ethtool-util.c
+++ b/src/udev/net/ethtool-util.c
@@ -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;