]> git.baikalelectronics.ru Git - kernel.git/commit
fib_rules: fix fib rule dumps across multiple skbs
authorWilson Kok <wkok@cumulusnetworks.com>
Wed, 23 Sep 2015 04:40:22 +0000 (21:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Sep 2015 22:21:54 +0000 (15:21 -0700)
commitf7ef8d2738874ab6bad9b7078939c3c9cb48dbe4
treefc120c8671eeca949423e0d750c7c116abb212cc
parent9b4aa9b5decc49fe30c5b1e789657a3a818af406
fib_rules: fix fib rule dumps across multiple skbs

dump_rules returns skb length and not error.
But when family == AF_UNSPEC, the caller of dump_rules
assumes that it returns an error. Hence, when family == AF_UNSPEC,
we continue trying to dump on -EMSGSIZE errors resulting in
incorrect dump idx carried between skbs belonging to the same dump.
This results in fib rule dump always only dumping rules that fit
into the first skb.

This patch fixes dump_rules to return error so that we exit correctly
and idx is correctly maintained between skbs that are part of the
same dump.

Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/fib_rules.c