]> git.hungrycats.org Git - linux/commitdiff
[DECNET]: Fix route device refcounting.
authorSteven Whitehouse <steve@gw.chygwyn.com>
Mon, 12 Aug 2002 03:54:50 +0000 (20:54 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 12 Aug 2002 03:54:50 +0000 (20:54 -0700)
net/decnet/af_decnet.c
net/decnet/dn_route.c

index 113d8d8a02f536d0c41d578167b076c5bedf5718..a8e81d8972ac526f9f87aa89ff047f27d5c48d65 100644 (file)
@@ -2238,7 +2238,7 @@ MODULE_PARM(addr, "2i");
 MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
 #endif
 
-static char banner[] __initdata = KERN_INFO "NET4: DECnet for Linux: V.2.4.15-pre5s (C) 1995-2001 Linux DECnet Project Team\n";
+static char banner[] __initdata = KERN_INFO "NET4: DECnet for Linux: V.2.4.20-pre1s (C) 1995-2002 Linux DECnet Project Team\n";
 
 static int __init decnet_init(void)
 {
index 49f28b21159c4dab158a31f0b8b2ae0089ef3109..a02f53734033512501e76621a304bf95abc8b9c4 100644 (file)
@@ -35,6 +35,8 @@
  *                                 are numbered!
  *              Steve Whitehouse : Added return-to-sender functions. Added
  *                                 backlog congestion level return codes.
+ *             Steve Whitehouse : Fixed bug where routes were set up with
+ *                                 no ref count on net devices.
  *                                 
  */
 
@@ -801,6 +803,8 @@ got_route:
 
        rt->u.dst.neighbour = neigh;
        rt->u.dst.dev = neigh ? neigh->dev : NULL;
+       if (rt->u.dst.dev)
+               dev_hold(rt->u.dst.dev);
        rt->u.dst.lastuse = jiffies;
        rt->u.dst.output = dn_output;
        rt->u.dst.input  = dn_rt_bug;
@@ -978,6 +982,8 @@ add_entry:
 
        rt->u.dst.neighbour = neigh;
        rt->u.dst.dev = neigh ? neigh->dev : NULL;
+       if (rt->u.dst.dev)
+               dev_hold(rt->u.dst.dev);
        rt->u.dst.lastuse = jiffies;
        rt->u.dst.output = dnrt_output;
        rt->u.dst.input = dnrt_input;