]> git.baikalelectronics.ru Git - kernel.git/commit
[RTNETLINK] Fix RTM_MAX to represent the maximum valid message type
authorThomas Graf <tgraf@suug.ch>
Tue, 3 May 2005 21:27:35 +0000 (14:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 May 2005 21:27:35 +0000 (14:27 -0700)
commit0176d3eac849fe5c7e9ea1437551fd7761916e3d
tree0e335d1e65c254326e1e8cafd05cb440b2474d9c
parent4bb8693688e75cc40c64146ae58f6136c5b73d00
[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>
include/linux/rtnetlink.h