net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
Subsystems (2)
PATCH 1/1 net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
Ignore the new NETDEV_PRE_TYPE_CHANGE event in rtnetlink_event() since there have been no changes userspace needs to be notified of.
Also add a comment to the netdev notifier event definitions to remind people to update the exclusion list when adding new event types.
--- include/linux/notifier.h | 5 ++++- net/core/rtnetlink.c | 1 + 2 files changed, 5 insertions(+), 1 deletions(-)
include/linux/notifier.h +4 -1
@@ -182,7 +182,10 @@ static inline int notifier_to_errno(int ret)* VC switch chains (for loadable kernel svgalib VC switch helpers) etc... */ -/* netdevice notifier chain */ +/* netdevice notifier chain. Please remember to update the rtnetlink +* notification exclusion list in rtnetlink_event() when adding new +* types. +*/ #define NETDEV_UP 0x0001/* For now you can't veto a device up/down */ #define NETDEV_DOWN 0x0002#define NETDEV_REBOOT 0x0003/* Tell a protocol stack a network interface
net/core/rtnetlink.c +1 -0
@@ -1513,6 +1513,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_POST_INIT :case NETDEV_REGISTER :case NETDEV_CHANGE : +case NETDEV_PRE_TYPE_CHANGE :case NETDEV_GOING_DOWN :case NETDEV_UNREGISTER :case NETDEV_UNREGISTER_BATCH :
Signature · 1 line
1.6.5.7
Quoted 7 lines · Fri, Mar 19, 2010 at 03:42:24PM CET, [email protected] wrote:
Ignore the new
NETDEV_PRE_TYPE_CHANGEevent inrtnetlink_event()since there have been no changes userspace needs to be notified of.Also add a comment to the netdev notifier event definitions to remind people to update the exclusion list when adding new event types.
Hmm, didn't have a clue this is needed. Anyway, original "NETDEV_BONDING_OLDTYPE" and "NETDEV_BONDING_NEWTYPE" weren't here either. Also you might want to add "NETDEV_POST_TYPE_CHANGE".
Jirka
Quoted 38 lines
Signed-off-by Patrick McHardy <[email protected]>---
include/linux/notifier.h | 5 ++++- net/core/rtnetlink.c | 1 + 2 files changed, 5 insertions(+), 1 deletions(-)include/linux/notifier.h +4
-1@@ -182,7 +182,10 @@ static inline int notifier_to_errno(int ret)* VC switch chains (for loadable kernel svgalib VC switch helpers) etc... */ -/* netdevice notifier chain */ +/* netdevice notifier chain. Please remember to update the rtnetlink +* notification exclusion list in rtnetlink_event() when adding new +* types. +*/ #define NETDEV_UP 0x0001/* For now you can't veto a device up/down */ #define NETDEV_DOWN 0x0002#define NETDEV_REBOOT 0x0003/* Tell a protocol stack a network interface net/core/rtnetlink.c +1
-0@@ -1513,6 +1513,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voicase NETDEV_POST_INIT :case NETDEV_REGISTER :case NETDEV_CHANGE : +case NETDEV_PRE_TYPE_CHANGE :case NETDEV_GOING_DOWN :case NETDEV_UNREGISTER :case NETDEV_UNREGISTER_BATCH :Signature · 1 line
1.6.5.7
Quoted 4 lines · Jiri Pirko
Fri, Mar 19, 2010 at 03:42:24PM CET, [email protected] wrote:
Quoted 8 lines
Quoted 5 lines
Ignore the new
NETDEV_PRE_TYPE_CHANGEevent inrtnetlink_event()since there have been no changes userspace needs to be notified of.Also add a comment to the netdev notifier event definitions to remind people to update the exclusion list when adding new event types.
Hmm, didn't have a clue this is needed. Anyway, original "
NETDEV_BONDING_OLDTYPE" and "NETDEV_BONDING_NEWTYPE" weren't here either.
Its not strictly needed, it just avoids sending events without new information.
Quoted 1 line
Also you might want to add "
NETDEV_POST_TYPE_CHANGE".
I left this out on purpose since userspace might be interested in the type change.
From: Patrick McHardy <[email protected]>
Date: Fri, 19 Mar 2010 15:42:24 +0100
Quoted 7 lines
Ignore the new
NETDEV_PRE_TYPE_CHANGEevent inrtnetlink_event()since there have been no changes userspace needs to be notified of.Also add a comment to the netdev notifier event definitions to remind people to update the exclusion list when adding new event types.
Signed-off-by Patrick McHardy <[email protected]>
Applied.