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

ipv4: Cache source address in nexthop entries.


When doing output route lookups, we have to select the source address
if the user has not specified an explicit one.

First, if the route has an explicit preferred source address
specified, then we use that.

Otherwise we search the route's outgoing interface for a suitable
address.

This search can be precomputed and cached at route insertion time.

The only missing part is that we have to refresh this precomputed
value any time addresses are added or removed from the interface, and
this is accomplished by fib_update_nh_saddrs().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6118e35a
No related merge requests found
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