ipv4: Validate route entry type at insert instead of every lookup.
authorDavid S. Miller <davem@davemloft.net>
Mon, 7 Mar 2011 22:27:38 +0000 (14:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Mar 2011 22:27:38 +0000 (14:27 -0800)
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: David S. Miller <davem@davemloft.net>

No differences found