diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-05-03 17:27:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-03 17:27:35 -0400 |
commit | d775fc09f16f4b88cd0373006b112c4772589778 (patch) | |
tree | 0e335d1e65c254326e1e8cafd05cb440b2474d9c | |
parent | 492b558b3191319cbc859a9e025bc354d336c261 (diff) |
[RTNETLINK] Fix RTM_MAX to represent the maximum valid message type
RTM_MAX is currently set to the maximum reserverd message type plus one
thus being the cause of two bugs for new types being assigned a) given the
new family registers only the NEW command in its reserved block the array
size for per family entries is calculated one entry short and b) given the
new family registers all commands RTM_MAX would point to the first entry
of the block following this one and the rtnetlink receive path would accept
a message type for a nonexisting family.
This patch changes RTM_MAX to point to the maximum valid message type
by aligning it to the start of the next block and subtracting one.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/rtnetlink.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 32e52769a00b..d607219af6ac 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -89,8 +89,8 @@ enum { | |||
89 | RTM_GETANYCAST = 62, | 89 | RTM_GETANYCAST = 62, |
90 | #define RTM_GETANYCAST RTM_GETANYCAST | 90 | #define RTM_GETANYCAST RTM_GETANYCAST |
91 | 91 | ||
92 | RTM_MAX, | 92 | __RTM_MAX, |
93 | #define RTM_MAX RTM_MAX | 93 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
94 | }; | 94 | }; |
95 | 95 | ||
96 | /* | 96 | /* |