[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>

authored by Patrick Caulfield and committed by David S. Miller 9bbf28a1 dc49c1f9

+7 -2
+7 -2
net/decnet/dn_route.c
··· 925 925 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) { 926 926 if (!dev_out->dn_ptr) 927 927 continue; 928 - if (dn_dev_islocal(dev_out, oldflp->fld_src)) 929 - break; 928 + if (!dn_dev_islocal(dev_out, oldflp->fld_src)) 929 + continue; 930 + if ((dev_out->flags & IFF_LOOPBACK) && 931 + oldflp->fld_dst && 932 + !dn_dev_islocal(dev_out, oldflp->fld_dst)) 933 + continue; 934 + break; 930 935 } 931 936 read_unlock(&dev_base_lock); 932 937 if (dev_out == NULL)