• T
    [RTNETLINK] Fix RTM_MAX to represent the maximum valid message type · d775fc09
    Thomas Graf 提交于
    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: NThomas Graf <tgraf@suug.ch>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    d775fc09
rtnetlink.h 19.5 KB