提交 31248731 编写于 作者: D David S. Miller

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: NDavid S. Miller <davem@davemloft.net>
上级 2db2d67e
...@@ -158,34 +158,8 @@ static void ipv4_dst_ifdown(struct dst_entry *dst, struct net_device *dev, ...@@ -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) static u32 *ipv4_cow_metrics(struct dst_entry *dst, unsigned long old)
{ {
struct rtable *rt = (struct rtable *) dst; WARN_ON(1);
struct inet_peer *peer; return NULL;
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;
} }
static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册