Netdev List
 help / color / mirror / Atom feed
* [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

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