chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
55428d8
)
udev: link-config - use zero instead of memset
author
Tom Gundersen
<teg@jklm.no>
Tue, 29 Oct 2013 15:10:54 +0000
(16:10 +0100)
committer
Tom Gundersen
<teg@jklm.no>
Tue, 29 Oct 2013 15:12:12 +0000
(16:12 +0100)
src/udev/net/ethtool-util.c
patch
|
blob
|
history
diff --git
a/src/udev/net/ethtool-util.c
b/src/udev/net/ethtool-util.c
index 4fad52b469f28c6ef3216ad726bec04dc6e9d586..68ddd25a9068ebaf48fef3ac0c31885f3e0b1f60 100644
(file)
--- 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;
if (speed == 0 && duplex == _DUP_INVALID)
return 0;
-
memset(&ecmd, 0x00, sizeof(struct ethtool_cmd)
);
+
zero(ecmd
);
ecmd.cmd = ETHTOOL_GSET;
ecmd.cmd = ETHTOOL_GSET;
- memset(&ifr, 0x00, sizeof(struct ifreq));
+
+ zero(ifr);
strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
ifr.ifr_data = (void *)&ecmd;
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;
if (wol == _WOL_INVALID)
return 0;
-
memset(&ecmd, 0x00, sizeof(struct ethtool_wolinfo)
);
+
zero(ecmd
);
ecmd.cmd = ETHTOOL_GWOL;
ecmd.cmd = ETHTOOL_GWOL;
- memset(&ifr, 0x00, sizeof(struct ifreq));
+
+ zero(ifr);
strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
ifr.ifr_data = (void *)&ecmd;
strscpy(ifr.ifr_name, IFNAMSIZ, ifname);
ifr.ifr_data = (void *)&ecmd;