Skip to content

Commit 346f870

Browse files
committed
ipv6: Report TCP timetstamp info in cacheinfo just like ipv4 does.
I missed this while adding ipv6 support to inet_peer. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 95f56e7 commit 346f870

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎net/ipv6/route.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,11 +2360,13 @@ static int rt6_fill_node(struct net *net,
23602360
int iif, int type, u32 pid, u32 seq,
23612361
int prefix, int nowait, unsigned int flags)
23622362
{
2363+
const struct inet_peer *peer;
23632364
struct rtmsg *rtm;
23642365
struct nlmsghdr *nlh;
23652366
long expires;
23662367
u32 table;
23672368
struct neighbour *n;
2369+
u32 ts, tsage;
23682370

23692371
if (prefix) { /* user wants prefix routes only */
23702372
if (!(rt->rt6i_flags & RTF_PREFIX_RT)) {
@@ -2471,7 +2473,14 @@ static int rt6_fill_node(struct net *net,
24712473
else
24722474
expires = INT_MAX;
24732475

2474-
if (rtnl_put_cacheinfo(skb, &rt->dst, 0, 0, 0,
2476+
peer = rt->rt6i_peer;
2477+
ts = tsage = 0;
2478+
if (peer && peer->tcp_ts_stamp) {
2479+
ts = peer->tcp_ts;
2480+
tsage = get_seconds() - peer->tcp_ts_stamp;
2481+
}
2482+
2483+
if (rtnl_put_cacheinfo(skb, &rt->dst, 0, ts, tsage,
24752484
expires, rt->dst.error) < 0)
24762485
goto nla_put_failure;
24772486

0 commit comments

Comments
 (0)