summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Caulfield <patrick@tykepenguin.com>2006-08-02 14:14:44 -0700
committerDavid S. Miller <davem@davemloft.net>2006-08-02 14:14:44 -0700
commit9bbf28a1ff7b9d4e7df57829c25638721984277b (patch)
tree255bb57e1e2aef43301d962683f9be5eb33d1cc4
parentdc49c1f94e3469d94b952e8f5160dd4ccd791d79 (diff)
[DECNET]: Fix for routing bug
This patch fixes a bug in the DECnet routing code where we were selecting a loopback device in preference to an outward facing device even when the destination was known non-local. This patch should fix the problem. Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com> Signed-off-by: Steven Whitehouse <steve@chygwyn.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/decnet/dn_route.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 1355614ec11b..743e9fcf7c5a 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -925,8 +925,13 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
for(dev_out = dev_base; dev_out; dev_out = dev_out->next) {
if (!dev_out->dn_ptr)
continue;
- if (dn_dev_islocal(dev_out, oldflp->fld_src))
- break;
+ if (!dn_dev_islocal(dev_out, oldflp->fld_src))
+ continue;
+ if ((dev_out->flags & IFF_LOOPBACK) &&
+ oldflp->fld_dst &&
+ !dn_dev_islocal(dev_out, oldflp->fld_dst))
+ continue;
+ break;
}
read_unlock(&dev_base_lock);
if (dev_out == NULL)