diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 07:08:18 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-10 22:40:17 -0700 |
commit | 312487313d4f7177cb751830e3d9c218e42ed59e (patch) | |
tree | feac6ec40f28f12ea7bfee8cca2df719f1f22d50 /net/ipv4 | |
parent | 2db2d67e4cf6100249bad575d9c13c16fd7b06dc (diff) | |
download | linux-stable-312487313d4f7177cb751830e3d9c218e42ed59e.tar.gz linux-stable-312487313d4f7177cb751830e3d9c218e42ed59e.tar.bz2 linux-stable-312487313d4f7177cb751830e3d9c218e42ed59e.zip |
ipv4: Calling ->cow_metrics() now is a bug.
Nothing every writes to ipv4 metrics any longer.
PMTU is stored in rt->rt_pmtu.
Dynamic TCP metrics are stored in a special TCP metrics cache,
completely outside of the routes.
Therefore ->cow_metrics() can simply nothing more than a WARN_ON
trigger so we can catch anyone who tries to add new writes to
ipv4 route metrics.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/route.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a967df54a423..9cc00f8a6ee5 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -158,34 +158,8 @@ static void ipv4_dst_ifdown(struct dst_entry *dst, struct net_device *dev, static u32 *ipv4_cow_metrics(struct dst_entry *dst, unsigned long old) { - struct rtable *rt = (struct rtable *) dst; - struct inet_peer *peer; - u32 *p = NULL; - - peer = rt_get_peer_create(rt, rt->rt_dst); - if (peer) { - u32 *old_p = __DST_METRICS_PTR(old); - unsigned long prev, new; - - p = peer->metrics; - if (inet_metrics_new(peer)) - memcpy(p, old_p, sizeof(u32) * RTAX_MAX); - - new = (unsigned long) p; - prev = cmpxchg(&dst->_metrics, old, new); - - if (prev != old) { - p = __DST_METRICS_PTR(prev); - if (prev & DST_METRICS_READ_ONLY) - p = NULL; - } else { - if (rt->fi) { - fib_info_put(rt->fi); - rt->fi = NULL; - } - } - } - return p; + WARN_ON(1); + return NULL; } static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, |