diff options
Diffstat (limited to 'src/shared/ethtool-util.c')
-rw-r--r-- | src/shared/ethtool-util.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index e2b2ca2352..e978b8bf7e 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -434,6 +434,8 @@ int ethtool_set_wol( strscpy(ifr.ifr_name, sizeof(ifr.ifr_name), ifname); + CLEANUP_ERASE(ecmd); + if (ioctl(*ethtool_fd, SIOCETHTOOL, &ifr) < 0) return -errno; @@ -466,16 +468,11 @@ int ethtool_set_wol( need_update = true; } - if (!need_update) { - explicit_bzero_safe(&ecmd, sizeof(ecmd)); + if (!need_update) return 0; - } ecmd.cmd = ETHTOOL_SWOL; - r = RET_NERRNO(ioctl(*ethtool_fd, SIOCETHTOOL, &ifr)); - - explicit_bzero_safe(&ecmd, sizeof(ecmd)); - return r; + return RET_NERRNO(ioctl(*ethtool_fd, SIOCETHTOOL, &ifr)); } int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, const netdev_ring_param *ring) { |