• David S. Miller's avatar
    ipv4: Validate route entry type at insert instead of every lookup. · 4c8237cd
    David S. Miller authored
    fib_semantic_match() requires that if the type doesn't signal an
    automatic error, it must be of type RTN_UNICAST, RTN_LOCAL,
    RTN_BROADCAST, RTN_ANYCAST, or RTN_MULTICAST.
    
    Checking this every route lookup is pointless work.
    
    Instead validate it during route insertion, via fib_create_info().
    
    Also, there was nothing making sure the type value was less than
    RTN_MAX, so add that missing check while we're here.
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4c8237cd
fib_semantics.c 30.1 KB