lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200213052111.19595-1-nobuta.keiya@fujitsu.com>
Date:   Thu, 13 Feb 2020 14:21:11 +0900
From:   Keiya Nobuta <nobuta.keiya@...itsu.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     netdev@...r.kernel.org, Keiya Nobuta <nobuta.keiya@...itsu.com>
Subject: [PATCH] net: sched: Add sysfs_notify for /sys/class/net/*/carrier

This patch makes /sys/class/<iface>/carrier pollable and allows
application to monitor current physical link state changes.

Signed-off-by: Keiya Nobuta <nobuta.keiya@...itsu.com>
---
 net/sched/sch_generic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 6c9595f..67e4190 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -493,6 +493,7 @@ void netif_carrier_on(struct net_device *dev)
 		linkwatch_fire_event(dev);
 		if (netif_running(dev))
 			__netdev_watchdog_up(dev);
+		sysfs_notify(&dev->dev.kobj, NULL, "carrier");
 	}
 }
 EXPORT_SYMBOL(netif_carrier_on);
@@ -510,6 +511,7 @@ void netif_carrier_off(struct net_device *dev)
 			return;
 		atomic_inc(&dev->carrier_down_count);
 		linkwatch_fire_event(dev);
+		sysfs_notify(&dev->dev.kobj, NULL, "carrier");
 	}
 }
 EXPORT_SYMBOL(netif_carrier_off);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ