]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Cache source address in nexthop entries.
authorDavid S. Miller <davem@davemloft.net>
Tue, 8 Mar 2011 04:54:48 +0000 (20:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Mar 2011 04:54:48 +0000 (20:54 -0800)
commita572799191d669e234246eee2961285a16f50d45
treeb2cecf15f5de87997fb44b4a1025b48d473cd038
parentbaee7d5b9c62cfcda3c64a67c37b94709c70bdf0
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: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_frontend.c
net/ipv4/fib_semantics.c