* [patch net] ipv4: fix nexthop attlen check in fib_nh_match
@ 2014-10-13 9:54 Jiri Pirko
2014-10-13 12:22 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2014-10-13 9:54 UTC (permalink / raw)
To: netdev; +Cc: davem, kuznet, jmorris, yoshfuji, kaber
fib_nh_match does not match nexthops correctly. Example:
This command is not successful and route is removed. After this patch
applied, the route is correctly matched and result is:
RTNETLINK answers: No such process
Please consider this for stable trees as well.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
net/ipv4/fib_semantics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 5b6efb3..f99f41b 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -537,7 +537,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
return 1;
attrlen = rtnh_attrlen(rtnh);
- if (attrlen < 0) {
+ if (attrlen > 0) {
struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [patch net] ipv4: fix nexthop attlen check in fib_nh_match
2014-10-13 9:54 [patch net] ipv4: fix nexthop attlen check in fib_nh_match Jiri Pirko
@ 2014-10-13 12:22 ` Eric Dumazet
2014-10-13 14:34 ` Jiri Pirko
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2014-10-13 12:22 UTC (permalink / raw)
To: Jiri Pirko, Thomas Graf; +Cc: netdev, davem, kuznet, jmorris, yoshfuji, kaber
On Mon, 2014-10-13 at 11:54 +0200, Jiri Pirko wrote:
> fib_nh_match does not match nexthops correctly. Example:
>
> This command is not successful and route is removed. After this patch
> applied, the route is correctly matched and result is:
> RTNETLINK answers: No such process
>
> Please consider this for stable trees as well.
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
> net/ipv4/fib_semantics.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index 5b6efb3..f99f41b 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -537,7 +537,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
> return 1;
>
> attrlen = rtnh_attrlen(rtnh);
> - if (attrlen < 0) {
> + if (attrlen > 0) {
> struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
>
> nla = nla_find(attrs, attrlen, RTA_GATEWAY);
Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
Good catch, thanks !
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch net] ipv4: fix nexthop attlen check in fib_nh_match
2014-10-13 12:22 ` Eric Dumazet
@ 2014-10-13 14:34 ` Jiri Pirko
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2014-10-13 14:34 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Thomas Graf, netdev, davem, kuznet, jmorris, yoshfuji, kaber
Mon, Oct 13, 2014 at 02:22:46PM CEST, eric.dumazet@gmail.com wrote:
>On Mon, 2014-10-13 at 11:54 +0200, Jiri Pirko wrote:
>> fib_nh_match does not match nexthops correctly. Example:
>>
>> This command is not successful and route is removed. After this patch
>> applied, the route is correctly matched and result is:
>> RTNETLINK answers: No such process
>>
>> Please consider this for stable trees as well.
>>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>> net/ipv4/fib_semantics.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
>> index 5b6efb3..f99f41b 100644
>> --- a/net/ipv4/fib_semantics.c
>> +++ b/net/ipv4/fib_semantics.c
>> @@ -537,7 +537,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
>> return 1;
>>
>> attrlen = rtnh_attrlen(rtnh);
>> - if (attrlen < 0) {
>> + if (attrlen > 0) {
>> struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
>>
>> nla = nla_find(attrs, attrlen, RTA_GATEWAY);
>
>Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
>
>Good catch, thanks !
>
>Acked-by: Eric Dumazet <edumazet@google.com>
Thanks Eric. I reposted with your ack, fixes line and missing example.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-13 14:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13 9:54 [patch net] ipv4: fix nexthop attlen check in fib_nh_match Jiri Pirko
2014-10-13 12:22 ` Eric Dumazet
2014-10-13 14:34 ` Jiri Pirko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox