* [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
@ 2014-09-04 18:52 Vadim Kochan
2014-09-04 19:29 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Vadim Kochan @ 2014-09-04 18:52 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
This is ugly fix but solves the case when timestamp
or banner-label is printed before the cloned route will be skipped
by iproute filter which filters out all cached routes by default.
In such case timestamp will be printed twice:
Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
ip/ipmonitor.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 70f2a7a..2bd3fed 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -41,9 +41,6 @@ static int accept_msg(const struct sockaddr_nl *who,
{
FILE *fp = (FILE*)arg;
- if (timestamp)
- print_timestamp(fp);
-
if (n->nlmsg_type == RTM_NEWROUTE || n->nlmsg_type == RTM_DELROUTE) {
struct rtmsg *r = NLMSG_DATA(n);
int len = n->nlmsg_len - NLMSG_LENGTH(sizeof(*r));
@@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
return -1;
}
+ if (r->rtm_flags&RTM_F_CLONED)
+ return 0;
+
+ if (timestamp)
+ print_timestamp(fp);
+
if (r->rtm_family == RTNL_FAMILY_IPMR ||
r->rtm_family == RTNL_FAMILY_IP6MR) {
if (prefix_banner)
@@ -66,6 +69,10 @@ static int accept_msg(const struct sockaddr_nl *who,
return 0;
}
}
+
+ if (timestamp)
+ print_timestamp(fp);
+
if (n->nlmsg_type == RTM_NEWLINK || n->nlmsg_type == RTM_DELLINK) {
ll_remember_index(who, n, NULL);
if (prefix_banner)
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 18:52 [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes Vadim Kochan
@ 2014-09-04 19:29 ` Sergei Shtylyov
2014-09-04 19:35 ` Vadim Kochan
0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2014-09-04 19:29 UTC (permalink / raw)
To: Vadim Kochan, netdev
Hello.
On 09/04/2014 10:52 PM, Vadim Kochan wrote:
> This is ugly fix but solves the case when timestamp
> or banner-label is printed before the cloned route will be skipped
> by iproute filter which filters out all cached routes by default.
> In such case timestamp will be printed twice:
> Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
> Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
> 10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> ip/ipmonitor.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
> diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
> index 70f2a7a..2bd3fed 100644
> --- a/ip/ipmonitor.c
> +++ b/ip/ipmonitor.c
[...]
> @@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
> return -1;
> }
>
> + if (r->rtm_flags&RTM_F_CLONED)
Judging on the patched code, spaces are needed around &.
> + return 0;
> +
> + if (timestamp)
> + print_timestamp(fp);
> +
> if (r->rtm_family == RTNL_FAMILY_IPMR ||
> r->rtm_family == RTNL_FAMILY_IP6MR) {
> if (prefix_banner)
[...]
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 19:29 ` Sergei Shtylyov
@ 2014-09-04 19:35 ` Vadim Kochan
2014-09-04 19:54 ` Vlad Yasevich
0 siblings, 1 reply; 7+ messages in thread
From: Vadim Kochan @ 2014-09-04 19:35 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev
Thanks!
Should I re-send the fixed patch with some special subject after
comments/review ?
On Thu, Sep 4, 2014 at 10:29 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
>
> On 09/04/2014 10:52 PM, Vadim Kochan wrote:
>
>> This is ugly fix but solves the case when timestamp
>> or banner-label is printed before the cloned route will be skipped
>> by iproute filter which filters out all cached routes by default.
>> In such case timestamp will be printed twice:
>
>
>> Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
>> Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
>> 10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
>
>
>> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>> ---
>> ip/ipmonitor.c | 13 ++++++++++---
>> 1 file changed, 10 insertions(+), 3 deletions(-)
>
>
>> diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
>> index 70f2a7a..2bd3fed 100644
>> --- a/ip/ipmonitor.c
>> +++ b/ip/ipmonitor.c
>
> [...]
>
>> @@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
>> return -1;
>> }
>>
>> + if (r->rtm_flags&RTM_F_CLONED)
>
>
> Judging on the patched code, spaces are needed around &.
>
>
>> + return 0;
>> +
>> + if (timestamp)
>> + print_timestamp(fp);
>> +
>> if (r->rtm_family == RTNL_FAMILY_IPMR ||
>> r->rtm_family == RTNL_FAMILY_IP6MR) {
>> if (prefix_banner)
>
> [...]
>
> WBR, Sergei
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 19:35 ` Vadim Kochan
@ 2014-09-04 19:54 ` Vlad Yasevich
2014-09-04 19:59 ` Vadim Kochan
0 siblings, 1 reply; 7+ messages in thread
From: Vlad Yasevich @ 2014-09-04 19:54 UTC (permalink / raw)
To: Vadim Kochan, Sergei Shtylyov; +Cc: netdev
On 09/04/2014 03:35 PM, Vadim Kochan wrote:
> Thanks!
>
> Should I re-send the fixed patch with some special subject after
> comments/review ?
Typically a [PATCH v2] and so on if there are comments on v2.
-vlad
>
> On Thu, Sep 4, 2014 at 10:29 PM, Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
>> Hello.
>>
>>
>> On 09/04/2014 10:52 PM, Vadim Kochan wrote:
>>
>>> This is ugly fix but solves the case when timestamp
>>> or banner-label is printed before the cloned route will be skipped
>>> by iproute filter which filters out all cached routes by default.
>>> In such case timestamp will be printed twice:
>>
>>
>>> Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
>>> Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
>>> 10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
>>
>>
>>> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>>> ---
>>> ip/ipmonitor.c | 13 ++++++++++---
>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>
>>
>>> diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
>>> index 70f2a7a..2bd3fed 100644
>>> --- a/ip/ipmonitor.c
>>> +++ b/ip/ipmonitor.c
>>
>> [...]
>>
>>> @@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
>>> return -1;
>>> }
>>>
>>> + if (r->rtm_flags&RTM_F_CLONED)
>>
>>
>> Judging on the patched code, spaces are needed around &.
>>
>>
>>> + return 0;
>>> +
>>> + if (timestamp)
>>> + print_timestamp(fp);
>>> +
>>> if (r->rtm_family == RTNL_FAMILY_IPMR ||
>>> r->rtm_family == RTNL_FAMILY_IP6MR) {
>>> if (prefix_banner)
>>
>> [...]
>>
>> WBR, Sergei
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 19:54 ` Vlad Yasevich
@ 2014-09-04 19:59 ` Vadim Kochan
2014-09-04 20:01 ` Vadim Kochan
0 siblings, 1 reply; 7+ messages in thread
From: Vadim Kochan @ 2014-09-04 19:59 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: Sergei Shtylyov, netdev
Hm thats strange I changed subject of the fixed patch to the [PATCH
v2] form but it appeared in this thread w/o v2.
On Thu, Sep 4, 2014 at 10:54 PM, Vlad Yasevich <vyasevich@gmail.com> wrote:
> On 09/04/2014 03:35 PM, Vadim Kochan wrote:
>> Thanks!
>>
>> Should I re-send the fixed patch with some special subject after
>> comments/review ?
>
> Typically a [PATCH v2] and so on if there are comments on v2.
>
> -vlad
>
>>
>> On Thu, Sep 4, 2014 at 10:29 PM, Sergei Shtylyov
>> <sergei.shtylyov@cogentembedded.com> wrote:
>>> Hello.
>>>
>>>
>>> On 09/04/2014 10:52 PM, Vadim Kochan wrote:
>>>
>>>> This is ugly fix but solves the case when timestamp
>>>> or banner-label is printed before the cloned route will be skipped
>>>> by iproute filter which filters out all cached routes by default.
>>>> In such case timestamp will be printed twice:
>>>
>>>
>>>> Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
>>>> Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
>>>> 10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
>>>
>>>
>>>> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>>>> ---
>>>> ip/ipmonitor.c | 13 ++++++++++---
>>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>>
>>>
>>>> diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
>>>> index 70f2a7a..2bd3fed 100644
>>>> --- a/ip/ipmonitor.c
>>>> +++ b/ip/ipmonitor.c
>>>
>>> [...]
>>>
>>>> @@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
>>>> return -1;
>>>> }
>>>>
>>>> + if (r->rtm_flags&RTM_F_CLONED)
>>>
>>>
>>> Judging on the patched code, spaces are needed around &.
>>>
>>>
>>>> + return 0;
>>>> +
>>>> + if (timestamp)
>>>> + print_timestamp(fp);
>>>> +
>>>> if (r->rtm_family == RTNL_FAMILY_IPMR ||
>>>> r->rtm_family == RTNL_FAMILY_IP6MR) {
>>>> if (prefix_banner)
>>>
>>> [...]
>>>
>>> WBR, Sergei
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 19:59 ` Vadim Kochan
@ 2014-09-04 20:01 ` Vadim Kochan
2014-09-04 21:19 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Vadim Kochan @ 2014-09-04 20:01 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: Sergei Shtylyov, netdev
But here http://patchwork.ozlabs.org/project/netdev/list/ I see the v2.
On Thu, Sep 4, 2014 at 10:59 PM, Vadim Kochan <vadim4j@gmail.com> wrote:
> Hm thats strange I changed subject of the fixed patch to the [PATCH
> v2] form but it appeared in this thread w/o v2.
>
> On Thu, Sep 4, 2014 at 10:54 PM, Vlad Yasevich <vyasevich@gmail.com> wrote:
>> On 09/04/2014 03:35 PM, Vadim Kochan wrote:
>>> Thanks!
>>>
>>> Should I re-send the fixed patch with some special subject after
>>> comments/review ?
>>
>> Typically a [PATCH v2] and so on if there are comments on v2.
>>
>> -vlad
>>
>>>
>>> On Thu, Sep 4, 2014 at 10:29 PM, Sergei Shtylyov
>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>> Hello.
>>>>
>>>>
>>>> On 09/04/2014 10:52 PM, Vadim Kochan wrote:
>>>>
>>>>> This is ugly fix but solves the case when timestamp
>>>>> or banner-label is printed before the cloned route will be skipped
>>>>> by iproute filter which filters out all cached routes by default.
>>>>> In such case timestamp will be printed twice:
>>>>
>>>>
>>>>> Timestamp: Thu Sep 4 19:46:59 2014 457933 usec
>>>>> Timestamp: Thu Sep 4 19:47:07 2014 977970 usec
>>>>> 10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE
>>>>
>>>>
>>>>> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>>>>> ---
>>>>> ip/ipmonitor.c | 13 ++++++++++---
>>>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>>>
>>>>
>>>>> diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
>>>>> index 70f2a7a..2bd3fed 100644
>>>>> --- a/ip/ipmonitor.c
>>>>> +++ b/ip/ipmonitor.c
>>>>
>>>> [...]
>>>>
>>>>> @@ -53,6 +50,12 @@ static int accept_msg(const struct sockaddr_nl *who,
>>>>> return -1;
>>>>> }
>>>>>
>>>>> + if (r->rtm_flags&RTM_F_CLONED)
>>>>
>>>>
>>>> Judging on the patched code, spaces are needed around &.
>>>>
>>>>
>>>>> + return 0;
>>>>> +
>>>>> + if (timestamp)
>>>>> + print_timestamp(fp);
>>>>> +
>>>>> if (r->rtm_family == RTNL_FAMILY_IPMR ||
>>>>> r->rtm_family == RTNL_FAMILY_IP6MR) {
>>>>> if (prefix_banner)
>>>>
>>>> [...]
>>>>
>>>> WBR, Sergei
>>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes
2014-09-04 20:01 ` Vadim Kochan
@ 2014-09-04 21:19 ` Sergei Shtylyov
0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2014-09-04 21:19 UTC (permalink / raw)
To: Vadim Kochan, Vlad Yasevich; +Cc: netdev
On 09/05/2014 12:01 AM, Vadim Kochan wrote:
> But here http://patchwork.ozlabs.org/project/netdev/list/ I see the v2.
I'm seeing v2 on your posting as well.
> On Thu, Sep 4, 2014 at 10:59 PM, Vadim Kochan <vadim4j@gmail.com> wrote:
>> Hm thats strange I changed subject of the fixed patch to the [PATCH
>> v2] form but it appeared in this thread w/o v2.
The v2 is on its own thread (how it should be).
>> On Thu, Sep 4, 2014 at 10:54 PM, Vlad Yasevich <vyasevich@gmail.com> wrote:
>>> On 09/04/2014 03:35 PM, Vadim Kochan wrote:
>>>> Thanks!
>>>> Should I re-send the fixed patch with some special subject after
>>>> comments/review ?
>>> Typically a [PATCH v2] and so on if there are comments on v2.
>>> -vlad
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-04 21:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 18:52 [PATCH] ip monitor: Dont print timestamp or banner-label for cloned routes Vadim Kochan
2014-09-04 19:29 ` Sergei Shtylyov
2014-09-04 19:35 ` Vadim Kochan
2014-09-04 19:54 ` Vlad Yasevich
2014-09-04 19:59 ` Vadim Kochan
2014-09-04 20:01 ` Vadim Kochan
2014-09-04 21:19 ` Sergei Shtylyov
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).