From: Eric Dumazet <eduma...@google.com>

fib_lookup() forces FIB_LOOKUP_NOREF flag, while fib_table_lookup()
does not.

This patch solves the typical message at reboot time or device
dismantle :

unregister_netdevice: waiting for eth0 to become free. Usage count = 4

Fixes: 3bfd847203c6 ("net: Use passed in table for nexthop lookups")
Signed-off-by: Eric Dumazet <eduma...@google.com>
Cc: David Ahern <d...@cumulusnetworks.com>
---
 net/ipv4/fib_semantics.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index b7f1d20a9615..c8025851dac7 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -708,7 +708,8 @@ static int fib_check_nh(struct fib_config *cfg, struct 
fib_info *fi,
 
                        if (tbl)
                                err = fib_table_lookup(tbl, &fl4, &res,
-                                                  FIB_LOOKUP_IGNORE_LINKSTATE);
+                                                      
FIB_LOOKUP_IGNORE_LINKSTATE |
+                                                      FIB_LOOKUP_NOREF);
                        else
                                err = fib_lookup(net, &fl4, &res,
                                                 FIB_LOOKUP_IGNORE_LINKSTATE);


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to