netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: linkwatch: send change uevent on link changes
@ 2018-12-01 16:00 Jouke Witteveen
  2018-12-01 17:14 ` Stephen Hemminger
  2018-12-05  4:49 ` David Miller
  0 siblings, 2 replies; 10+ messages in thread
From: Jouke Witteveen @ 2018-12-01 16:00 UTC (permalink / raw)
  To: davem; +Cc: netdev

Make it easy for userspace to respond to acquisition/loss of carrier.
The uevent is picked up by udev and, on systems with systemd, the
device unit of the interface announces a configuration reload.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
---
I did not want to change the commit message into a systemd-howto, but
subscribing to udev events can be done through a line like
    ReloadPropagatedFrom=sys-subsystem-net-devices-%i.device
in a systemd unit file.

 net/core/link_watch.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index 7f51efb2b..66aeb88f8 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -162,6 +162,8 @@ static void linkwatch_do_dev(struct net_device *dev)
 			dev_deactivate(dev);
 
 		netdev_state_change(dev);
+
+		kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE);
 	}
 	dev_put(dev);
 }
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-12-06 20:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-01 16:00 [PATCH 1/2] net: linkwatch: send change uevent on link changes Jouke Witteveen
2018-12-01 17:14 ` Stephen Hemminger
2018-12-05  4:49 ` David Miller
2018-12-05 13:50   ` Jouke Witteveen
2018-12-05 19:45     ` David Miller
2018-12-05 22:38       ` Jouke Witteveen
2018-12-06  0:34         ` David Miller
2018-12-06  8:59           ` Jouke Witteveen
2018-12-06 20:10             ` David Miller
2018-12-06 20:40               ` Jouke Witteveen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).