* [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
@ 2010-03-19 14:42 Patrick McHardy
2010-03-19 14:47 ` Jiri Pirko
2010-03-22 1:31 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Patrick McHardy @ 2010-03-19 14:42 UTC (permalink / raw
To: David Miller; +Cc: jpirko, Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 01.diff --]
[-- Type: text/x-diff, Size: 1560 bytes --]
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.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
include/linux/notifier.h | 5 ++++-
net/core/rtnetlink.c | 1 +
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index f3635fc..9c5d3fa 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -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
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e1121f0..ffc6cf3 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1513,6 +1513,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
case 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:
--
1.6.5.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
2010-03-19 14:42 [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event() Patrick McHardy
@ 2010-03-19 14:47 ` Jiri Pirko
2010-03-19 14:56 ` Patrick McHardy
2010-03-22 1:31 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2010-03-19 14:47 UTC (permalink / raw
To: Patrick McHardy; +Cc: David Miller, Linux Netdev List
Fri, Mar 19, 2010 at 03:42:24PM CET, kaber@trash.net wrote:
>
>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.
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
>
>Signed-off-by: Patrick McHardy <kaber@trash.net>
>---
> include/linux/notifier.h | 5 ++++-
> net/core/rtnetlink.c | 1 +
> 2 files changed, 5 insertions(+), 1 deletions(-)
>
>diff --git a/include/linux/notifier.h b/include/linux/notifier.h
>index f3635fc..9c5d3fa 100644
>--- a/include/linux/notifier.h
>+++ b/include/linux/notifier.h
>@@ -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
>diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
>index e1121f0..ffc6cf3 100644
>--- a/net/core/rtnetlink.c
>+++ b/net/core/rtnetlink.c
>@@ -1513,6 +1513,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
> case 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:
>--
>1.6.5.7
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
2010-03-19 14:47 ` Jiri Pirko
@ 2010-03-19 14:56 ` Patrick McHardy
0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2010-03-19 14:56 UTC (permalink / raw
To: Jiri Pirko; +Cc: David Miller, Linux Netdev List
Jiri Pirko wrote:
> Fri, Mar 19, 2010 at 03:42:24PM CET, kaber@trash.net wrote:
>
>
>
>> 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.
>
> 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.
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event()
2010-03-19 14:42 [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event() Patrick McHardy
2010-03-19 14:47 ` Jiri Pirko
@ 2010-03-22 1:31 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-03-22 1:31 UTC (permalink / raw
To: kaber; +Cc: jpirko, netdev
From: Patrick McHardy <kaber@trash.net>
Date: Fri, 19 Mar 2010 15:42:24 +0100
> 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.
>
> Signed-off-by: Patrick McHardy <kaber@trash.net>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-22 1:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 14:42 [PATCH] net: rtnetlink: ignore NETDEV_PRE_TYPE_CHANGE in rtnetlink_event() Patrick McHardy
2010-03-19 14:47 ` Jiri Pirko
2010-03-19 14:56 ` Patrick McHardy
2010-03-22 1:31 ` David Miller
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 read-only IMAP folder(s) and NNTP newsgroup(s).