Commit ddd4aa42 authored by David S. Miller's avatar David S. Miller

inetpeer: Add redirect and PMTU discovery cached info.

Validity of the cached PMTU information is indicated by it's
expiration value being non-zero, just as per dst->expires.

The scheme we will use is that we will remember the pre-ICMP value
held in the metrics or route entry, and then at expiration time
we will restore that value.

In this way PMTU expiration does not kill off the cached route as is
done currently.

Redirect information is permanent, or at least until another redirect
is received.
Signed-off-by: default avatarDavid S. Miller <>
parent 7a71ed89
...@@ -50,6 +50,10 @@ struct inet_peer { ...@@ -50,6 +50,10 @@ struct inet_peer {
u32 metrics[RTAX_MAX]; u32 metrics[RTAX_MAX];
u32 rate_tokens; /* rate limiting for ICMP */ u32 rate_tokens; /* rate limiting for ICMP */
unsigned long rate_last; unsigned long rate_last;
unsigned long pmtu_expires;
u32 pmtu_orig;
u32 pmtu_learned;
struct inetpeer_addr_base redirect_learned;
}; };
struct rcu_head rcu; struct rcu_head rcu;
}; };
...@@ -515,6 +515,8 @@ struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create) ...@@ -515,6 +515,8 @@ struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
p->rate_tokens = 0; p->rate_tokens = 0;
p->rate_last = 0; p->rate_last = 0;
p->pmtu_expires = 0;
memset(&p->redirect_learned, 0, sizeof(p->redirect_learned));
INIT_LIST_HEAD(&p->unused); INIT_LIST_HEAD(&p->unused);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment