Skip to contentSkip to conversation

vlan: Propagate NETDEV_NOTIFY_PEERS notifier

PATCH In review Ben Hutchings 1 participant 1 message Apr 15, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 vlan: Propagate NETDEV_NOTIFY_PEERS notifier

The NETDEV_NOTIFY_PEERS notifier indicates that a device moved to a different physical link; this also applies to any VLAN devices on top of it.

---
 net/8021q/vlan.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
net/8021q/vlan.c +11 -0
index 14ef5ef..b2ff70f 100644
@@ -499,6 +499,17 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 	case NETDEV_PRE_TYPE_CHANGE:
 		/* Forbid underlaying device to change its type. */
 		return NOTIFY_BAD;
+
+	case NETDEV_NOTIFY_PEERS:
+		/* Propagate to vlan devices */
+		for (i = 0; i < VLAN_N_VID; i++) {
+			vlandev = vlan_group_get_device(grp, i);
+			if (!vlandev)
+				continue;
+
+			call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, vlandev);
+		}
+		break;
 	}
 
 out:
Signature · 8 lines
1.7.4



-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.