summaryrefslogtreecommitdiff
path: root/net/ethtool/wol.c
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2020-01-26 23:11:19 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-27 11:31:36 +0100
commit67bffa79231f15ba372007972563cc8aa5e48bfa (patch)
treed1aa3d47c4ac13d64bebe5099a7e52eb4a95ca83 /net/ethtool/wol.c
parent8d425b19b305a77cb1ba67b84e7c1ca547de032f (diff)
ethtool: add WOL_NTF notification
Send ETHTOOL_MSG_WOL_NTF notification whenever wake-on-lan settings of a device are modified using ETHTOOL_MSG_WOL_SET netlink message or ETHTOOL_SWOL ioctl request. As notifications can be received by anyone, do not include SecureOn(tm) password in notification messages. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/wol.c')
-rw-r--r--net/ethtool/wol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ethtool/wol.c b/net/ethtool/wol.c
index a2724378fac4..e1b8a65b64c4 100644
--- a/net/ethtool/wol.c
+++ b/net/ethtool/wol.c
@@ -41,7 +41,8 @@ static int wol_prepare_data(const struct ethnl_req_info *req_base,
return ret;
dev->ethtool_ops->get_wol(dev, &data->wol);
ethnl_ops_complete(dev);
- data->show_sopass = data->wol.supported & WAKE_MAGICSECURE;
+ /* do not include password in notifications */
+ data->show_sopass = info && (data->wol.supported & WAKE_MAGICSECURE);
return 0;
}
@@ -165,6 +166,7 @@ int ethnl_set_wol(struct sk_buff *skb, struct genl_info *info)
if (ret)
goto out_ops;
dev->wol_enabled = !!wol.wolopts;
+ ethtool_notify(dev, ETHTOOL_MSG_WOL_NTF, NULL);
out_ops:
ethnl_ops_complete(dev);