Thread (10 messages) 10 messages, 3 authors, 2018-12-06

[PATCH 1/2] net: linkwatch: send change uevent on link changes

flat view
STALE2878d

From: Jouke Witteveen <hidden>
Date: 2018-12-02 03:13:18
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help