diff options
-rw-r--r-- | include/linux/xfrm.h | 1 | ||||
-rw-r--r-- | include/net/xfrm.h | 3 | ||||
-rw-r--r-- | net/ipv6/xfrm6_output.c | 2 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 3 |
4 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index b53f799189af..1d8c1f22c12d 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -236,6 +236,7 @@ enum xfrm_attr_type_t { | |||
236 | XFRMA_ETIMER_THRESH, | 236 | XFRMA_ETIMER_THRESH, |
237 | XFRMA_SRCADDR, /* xfrm_address_t */ | 237 | XFRMA_SRCADDR, /* xfrm_address_t */ |
238 | XFRMA_COADDR, /* xfrm_address_t */ | 238 | XFRMA_COADDR, /* xfrm_address_t */ |
239 | XFRMA_LASTUSED, | ||
239 | __XFRMA_MAX | 240 | __XFRMA_MAX |
240 | 241 | ||
241 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 242 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 872a2a4022b2..248874ecf8df 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -167,6 +167,9 @@ struct xfrm_state | |||
167 | struct xfrm_lifetime_cur curlft; | 167 | struct xfrm_lifetime_cur curlft; |
168 | struct timer_list timer; | 168 | struct timer_list timer; |
169 | 169 | ||
170 | /* Last used time */ | ||
171 | u64 lastused; | ||
172 | |||
170 | /* Reference to data common to all the instances of this | 173 | /* Reference to data common to all the instances of this |
171 | * transformer. */ | 174 | * transformer. */ |
172 | struct xfrm_type *type; | 175 | struct xfrm_type *type; |
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index b4628fbf8ff5..db58104e710b 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c | |||
@@ -75,6 +75,8 @@ static int xfrm6_output_one(struct sk_buff *skb) | |||
75 | 75 | ||
76 | x->curlft.bytes += skb->len; | 76 | x->curlft.bytes += skb->len; |
77 | x->curlft.packets++; | 77 | x->curlft.packets++; |
78 | if (x->props.mode == XFRM_MODE_ROUTEOPTIMIZATION) | ||
79 | x->lastused = (u64)xtime.tv_sec; | ||
78 | 80 | ||
79 | spin_unlock_bh(&x->lock); | 81 | spin_unlock_bh(&x->lock); |
80 | 82 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 939808de9e20..f643063a1cbd 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -595,6 +595,9 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr) | |||
595 | if (x->coaddr) | 595 | if (x->coaddr) |
596 | RTA_PUT(skb, XFRMA_COADDR, sizeof(*x->coaddr), x->coaddr); | 596 | RTA_PUT(skb, XFRMA_COADDR, sizeof(*x->coaddr), x->coaddr); |
597 | 597 | ||
598 | if (x->lastused) | ||
599 | RTA_PUT(skb, XFRMA_LASTUSED, sizeof(x->lastused), &x->lastused); | ||
600 | |||
598 | nlh->nlmsg_len = skb->tail - b; | 601 | nlh->nlmsg_len = skb->tail - b; |
599 | out: | 602 | out: |
600 | sp->this_idx++; | 603 | sp->this_idx++; |