From: Varun Chandramohan <varunc@linux.vnet.ibm.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: netdev@vger.kernel.org, sri@us.ibm.com, dlstevens@us.ibm.com,
varuncha@in.ibm.com
Subject: Re: [PATCH 4/4] Initialize and fill IPv6 route age
Date: Tue, 24 Jul 2007 09:50:57 +0530 [thread overview]
Message-ID: <46A57E29.9040404@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070723123429.15715972@oldman.hamilton.local>
Stephen Hemminger wrote:
> On Mon, 23 Jul 2007 10:13:18 +0530
> Varun Chandramohan <varunc@linux.vnet.ibm.com> wrote:
>
>
>> The age field of the ipv6 route structures are initilized with the current timeval at the time of route creation. When the route dump is called the route age value stored in the structure is subtracted from the present timeval and the difference is passed on as the route age.
>>
>> Signed-off-by: Varun Chandramohan <varunc@linux.vnet.ibm.com>
>> ---
>> include/net/ip6_fib.h | 1 +
>> include/net/ip6_route.h | 3 +++
>> net/ipv6/addrconf.c | 5 +++++
>> net/ipv6/route.c | 23 +++++++++++++++++++----
>> 4 files changed, 28 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
>> index c48ea87..e30a1cf 100644
>> --- a/include/net/ip6_fib.h
>> +++ b/include/net/ip6_fib.h
>> @@ -98,6 +98,7 @@ struct rt6_info
>>
>> u32 rt6i_flags;
>> u32 rt6i_metric;
>> + time_t rt6i_age;
>> atomic_t rt6i_ref;
>> struct fib6_table *rt6i_table;
>>
>> diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
>> index 5456fdd..fc9716c 100644
>> --- a/include/net/ip6_route.h
>> +++ b/include/net/ip6_route.h
>> @@ -36,6 +36,9 @@ struct route_info {
>> #define RT6_LOOKUP_F_REACHABLE 0x2
>> #define RT6_LOOKUP_F_HAS_SADDR 0x4
>>
>> +#define RT6_SET_ROUTE_INFO 0x0
>> +#define RT6_GET_ROUTE_INFO 0x1
>> +
>> extern struct rt6_info ip6_null_entry;
>>
>> #ifdef CONFIG_IPV6_MULTIPLE_TABLES
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index 5a5f8bd..715c766 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -4187,6 +4187,7 @@ EXPORT_SYMBOL(unregister_inet6addr_notif
>>
>> int __init addrconf_init(void)
>> {
>> + struct timeval tv;
>> int err = 0;
>>
>> /* The addrconf netdev notifier requires that loopback_dev
>> @@ -4214,10 +4215,14 @@ int __init addrconf_init(void)
>> if (err)
>> return err;
>>
>> + do_gettimeofday(&tv);
>>
>
> Better to use ktime_t or timespec in new code.
>
You are saying not to use timeval as its going to be removed sometime in
future? If not, may i know why should we use timespec or ktime?
I need only seconds granularity so i was wondering if that matters.
Regards,
Varun
next prev parent reply other threads:[~2007-07-24 4:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 4:43 [PATCH 4/4] Initialize and fill IPv6 route age Varun Chandramohan
2007-07-23 7:56 ` Krishna Kumar2
2007-07-23 11:34 ` Stephen Hemminger
2007-07-24 4:20 ` Varun Chandramohan [this message]
2007-07-24 7:26 ` Stephen Hemminger
2007-07-24 9:19 ` Varun Chandramohan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A57E29.9040404@linux.vnet.ibm.com \
--to=varunc@linux.vnet.ibm.com \
--cc=dlstevens@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=sri@us.ibm.com \
--cc=varuncha@in.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).