Skip to content
Snippets Groups Projects
Commit 4c8237cd authored by David S. Miller's avatar David S. Miller
Browse files

ipv4: Validate route entry type at insert instead of every lookup.


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>
parent 256ee435
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment