Thread (12 messages) 12 messages, 5 authors, 2008-11-26

Re: [PATCH] netdev: generate kobject uevent on network events.

From: Ben Hutchings <hidden>
Date: 2008-11-24 20:06:20

On Mon, 2008-11-24 at 11:45 -0800, Stephen Hemminger wrote:
[...]
+	case NETDEV_CHANGE:
+		if (netif_running(netdev)) {
+			char str[64] = "DEVSTATE=UP";
+			char *envp[2] = { str, NULL };
+
+			if (netif_oper_up(netdev))
+				strcat(str, ",RUNNING");
+			if (netif_carrier_ok(netdev))
+				strcat(str, ",LOWER_UP");
+			if (netif_dormant(netdev))
+				strcat(str, ",DORMANT");
+			kobject_uevent_env(&netdev->dev.kobj, KOBJ_CHANGE, envp);
+		}
+		break;
Unless I'm much mistaken, NETDEV_CHANGE should only be generated when
netif_running() is true, so the test is redundant.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help