From: Varun Chandramohan <varunc@linux.vnet.ibm.com>
To: Krishna Kumar2 <krkumar2@in.ibm.com>
Cc: davem@davemloft.net, kaber@trash.net, netdev@vger.kernel.org,
shemminger@linux-foundation.org, socketcan@hartkopp.net,
tgraf@suug.ch, Varun Chandramohan <varuncha@in.ibm.com>
Subject: Re: [PATCH 3/3 Rev4] Initialize and fill IPv6 route age
Date: Fri, 21 Sep 2007 10:00:35 +0530 [thread overview]
Message-ID: <46F348EB.1080402@linux.vnet.ibm.com> (raw)
In-Reply-To: <OF5159F66B.5A5F01B8-ON6525735D.000FD530-6525735D.0010F45F@in.ibm.com>
Krishna Kumar2 wrote:
> Varun Chandramohan <varunc@linux.vnet.ibm.com> wrote on 09/20/2007 08:59:03
> PM:
>
>
>> @@ -2123,6 +2131,7 @@ static int rt6_fill_node(struct sk_buff
>> {
>> struct rtmsg *rtm;
>> struct nlmsghdr *nlh;
>> + struct timeval tv;
>> long expires;
>> u32 table;
>>
>> @@ -2186,6 +2195,11 @@ static int rt6_fill_node(struct sk_buff
>> if (ipv6_get_saddr(&rt->u.dst, dst, &saddr_buf) == 0)
>> NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf);
>> }
>> +
>> + do_gettimeofday(&tv);
>> + if (rt->rt6i_age) {
>> + NLA_PUT_U32(skb, RTA_AGE, (tv.tv_sec - rt->rt6i_age));
>> + }
>>
>
> Will rt6i_age ever be zero with this new patch? If it can be zero,
> the code should really be keeping the "tv" declaration and
> do_gettimeofday() inside the "if (rt->rt6i_age)" check.
>
>
No, it will be zero only if some new code added doesnt initialize the
route age. I will update this change in my next patch release.
> And from your Patch2/3:
>
> int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
> - u32 tb_id, u8 type, u8 scope, __be32 dst, int
> dst_len, u8 tos,
> + u32 tb_id, u8 type, u8 scope, __be32 dst, int
> dst_len, u8 tos, time_t age,
> struct fib_info *fi, unsigned int flags)
> {
> struct nlmsghdr *nlh;
> struct rtmsg *rtm;
> + struct timeval tv;
>
> nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags);
> if (nlh == NULL)
> @@ -985,6 +987,11 @@ int fib_dump_info(struct sk_buff *skb, u
> NLA_PUT_U32(skb, RTA_FLOW,
> fi->fib_nh[0].nh_tclassid);
> #endif
> }
> +
> + do_gettimeofday(&tv);
> + if (age) {
> + NLA_PUT_U32(skb, RTA_AGE, (tv.tv_sec - age));
> + }
>
> Don't you want to return time the first time (and get zero)? Otherwise
> RTA_AGE is not returned to user. Something like:
>
>
The first time it will be zero.
> do_gettimeofday(&tv);
> NLA_PUT_U32(skb, RTA_AGE, (tv.tv_sec - age));
>
> Once again, can age ever be zero?
>
>
same as above.
> - KK
>
>
prev parent reply other threads:[~2007-09-21 4:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 15:29 [PATCH 3/3 Rev4] Initialize and fill IPv6 route age Varun Chandramohan
2007-09-21 3:05 ` Krishna Kumar2
2007-09-21 4:30 ` Varun Chandramohan [this message]
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=46F348EB.1080402@linux.vnet.ibm.com \
--to=varunc@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=krkumar2@in.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=socketcan@hartkopp.net \
--cc=tgraf@suug.ch \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.