aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r--net/decnet/dn_route.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 5abf7057af00..dd0761e3d280 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -55,7 +55,6 @@
55 GNU General Public License for more details. 55 GNU General Public License for more details.
56*******************************************************************************/ 56*******************************************************************************/
57 57
58#include <linux/config.h>
59#include <linux/errno.h> 58#include <linux/errno.h>
60#include <linux/types.h> 59#include <linux/types.h>
61#include <linux/socket.h> 60#include <linux/socket.h>
@@ -81,6 +80,7 @@
81#include <net/neighbour.h> 80#include <net/neighbour.h>
82#include <net/dst.h> 81#include <net/dst.h>
83#include <net/flow.h> 82#include <net/flow.h>
83#include <net/fib_rules.h>
84#include <net/dn.h> 84#include <net/dn.h>
85#include <net/dn_dev.h> 85#include <net/dn_dev.h>
86#include <net/dn_nsp.h> 86#include <net/dn_nsp.h>
@@ -926,8 +926,13 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
926 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) { 926 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) {
927 if (!dev_out->dn_ptr) 927 if (!dev_out->dn_ptr)
928 continue; 928 continue;
929 if (dn_dev_islocal(dev_out, oldflp->fld_src)) 929 if (!dn_dev_islocal(dev_out, oldflp->fld_src))
930 break; 930 continue;
931 if ((dev_out->flags & IFF_LOOPBACK) &&
932 oldflp->fld_dst &&
933 !dn_dev_islocal(dev_out, oldflp->fld_dst))
934 continue;
935 break;
931 } 936 }
932 read_unlock(&dev_base_lock); 937 read_unlock(&dev_base_lock);
933 if (dev_out == NULL) 938 if (dev_out == NULL)
@@ -1280,7 +1285,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1280 dev_hold(out_dev); 1285 dev_hold(out_dev);
1281 1286
1282 if (res.r) 1287 if (res.r)
1283 src_map = dn_fib_rules_policy(fl.fld_src, &res, &flags); 1288 src_map = fl.fld_src; /* no NAT support for now */
1284 1289
1285 gateway = DN_FIB_RES_GW(res); 1290 gateway = DN_FIB_RES_GW(res);
1286 if (res.type == RTN_NAT) { 1291 if (res.type == RTN_NAT) {
@@ -1481,6 +1486,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
1481 r->rtm_src_len = 0; 1486 r->rtm_src_len = 0;
1482 r->rtm_tos = 0; 1487 r->rtm_tos = 0;
1483 r->rtm_table = RT_TABLE_MAIN; 1488 r->rtm_table = RT_TABLE_MAIN;
1489 RTA_PUT_U32(skb, RTA_TABLE, RT_TABLE_MAIN);
1484 r->rtm_type = rt->rt_type; 1490 r->rtm_type = rt->rt_type;
1485 r->rtm_flags = (rt->rt_flags & ~0xFFFF) | RTM_F_CLONED; 1491 r->rtm_flags = (rt->rt_flags & ~0xFFFF) | RTM_F_CLONED;
1486 r->rtm_scope = RT_SCOPE_UNIVERSE; 1492 r->rtm_scope = RT_SCOPE_UNIVERSE;
@@ -1605,9 +1611,7 @@ int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
1605 goto out_free; 1611 goto out_free;
1606 } 1612 }
1607 1613
1608 err = netlink_unicast(rtnl, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); 1614 return rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
1609
1610 return err;
1611 1615
1612out_free: 1616out_free:
1613 kfree_skb(skb); 1617 kfree_skb(skb);
@@ -1777,14 +1781,9 @@ void __init dn_route_init(void)
1777{ 1781{
1778 int i, goal, order; 1782 int i, goal, order;
1779 1783
1780 dn_dst_ops.kmem_cachep = kmem_cache_create("dn_dst_cache", 1784 dn_dst_ops.kmem_cachep =
1781 sizeof(struct dn_route), 1785 kmem_cache_create("dn_dst_cache", sizeof(struct dn_route), 0,
1782 0, SLAB_HWCACHE_ALIGN, 1786 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
1783 NULL, NULL);
1784
1785 if (!dn_dst_ops.kmem_cachep)
1786 panic("DECnet: Failed to allocate dn_dst_cache\n");
1787
1788 init_timer(&dn_route_timer); 1787 init_timer(&dn_route_timer);
1789 dn_route_timer.function = dn_dst_check_expire; 1788 dn_route_timer.function = dn_dst_check_expire;
1790 dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ; 1789 dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ;