diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-10-11 01:12:02 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-08 14:40:40 -0500 |
commit | 2bc8ca40f951163b3bb75949479e2755c12c1b96 (patch) | |
tree | 1ca54c227a481d4cab0ca60a0f0533d5ae47042a /net/ipv4/route.c | |
parent | 20db93c34095553a01a9c31136658917bf1fa5d5 (diff) | |
download | op-kernel-dev-2bc8ca40f951163b3bb75949479e2755c12c1b96.zip op-kernel-dev-2bc8ca40f951163b3bb75949479e2755c12c1b96.tar.gz |
ipv4: Fix inetpeer expire time information
As we update the learned pmtu informations on demand, we might
report a nagative expiration time value to userspace if the
pmtu informations are already expired and we have not send a
packet to that inetpeer after expiration. With this patch we
send a expire time of null to userspace after expiration
until the next packet is send to that inetpeer.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 155138d..511f4a7 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2845,7 +2845,7 @@ static int rt_fill_info(struct net *net, struct rtable *rt = skb_rtable(skb); struct rtmsg *r; struct nlmsghdr *nlh; - long expires = 0; + unsigned long expires = 0; const struct inet_peer *peer = rt->peer; u32 id = 0, ts = 0, tsage = 0, error; @@ -2902,8 +2902,12 @@ static int rt_fill_info(struct net *net, tsage = get_seconds() - peer->tcp_ts_stamp; } expires = ACCESS_ONCE(peer->pmtu_expires); - if (expires) - expires -= jiffies; + if (expires) { + if (time_before(jiffies, expires)) + expires -= jiffies; + else + expires = 0; + } } if (rt_is_input_route(rt)) { |