]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2015 10:07:38 +0000 (12:07 +0200)
commitd0550a3f2d313a5310ace03299d45ef63edfb750
tree7463e67d99116df008e0810613ec7adef646cd4e
parente7bb902b26f1e8f7c1a4f0cc7b3abfd9b3fbb108
fib_rules: fix fib rule dumps across multiple skbs

[ Upstream commit 41fc014332d91ee90c32840bf161f9685b7fbf2b ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/fib_rules.c