Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242628
b: refs/heads/master
c: 406b6f9
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Mar 23, 2011
1 parent f5cf063 commit a2e22bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6152737a95bd6c22f0c664b20831aefd48085a8
refs/heads/master: 406b6f974dae76a5b795d5c251d11c979a4e509b
16 changes: 16 additions & 0 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
#include <net/rtnetlink.h>
#include <net/net_namespace.h>

#include "fib_lookup.h"

static struct ipv4_devconf ipv4_devconf = {
.data = {
[IPV4_DEVCONF_ACCEPT_REDIRECTS - 1] = 1,
Expand Down Expand Up @@ -151,6 +153,20 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
break;
}
}
if (!result) {
struct flowi4 fl4 = { .daddr = addr };
struct fib_result res = { 0 };
struct fib_table *local;

/* Fallback to FIB local table so that communication
* over loopback subnets work.
*/
local = fib_get_table(net, RT_TABLE_LOCAL);
if (local &&
!fib_table_lookup(local, &fl4, &res, FIB_LOOKUP_NOREF) &&
res.type == RTN_LOCAL)
result = FIB_RES_DEV(res);
}
if (result && devref)
dev_hold(result);
rcu_read_unlock();
Expand Down

0 comments on commit a2e22bf

Please sign in to comment.