Subject: [PATCH 0/4] Fix routing metrics

From: Steffen Klassert <[email-masked]>
Date: Thu, 2 Feb 2012 11:11:41 +0100

At the moment we initialize the routing metrics with the, on the inetpeer
cached values in rt_init_metrics(). So if we have the metrics cached on the
inetpeer, we ignore the user configured fib_metrics. This leads to the fact 
that we can't configure the mtu, hoplimit etc. if we have learned metrics 
cached. This patchset adds a possibility to invalidate and exchange the
cached inetpeer metrics. In detail it does:

1. Allocate the inetpeer metrics dynamically and add a reference
to the inetpeer.

2. Remove the direct reference of the inetpeer metrics from
dst->_metrics and access the metrics via the inetpeer reference
of the route. This makes it possible to exchange the inetpeer
metrics if they get invalidated.

3. Protect the inetpeer metrics with rcu.

4. Add a peer_genid to invalidate the metrics. When the peer_genid
is incremeted we allocate new metrics and exchange the metrics
pointer of the inetpeer.

For the case that such a approach is acceptable, I have another patch
to unify peer_genid and redirect_genid.