Re: [PATCH] 1/2 DECnet fix SDF_WILD

From: Patrick Caulfield
Date: Sat Jan 31 2004 - 06:41:55 EST


On Fri, Jan 30, 2004 at 12:43:48PM -0800, David S. Miller wrote:
> On Mon, 26 Jan 2004 11:31:06 +0000
> Patrick Caulfield <patrick@xxxxxxxxxxxxxxx> wrote:
>
> > This patch fixes the operation of SDF_WILD sockets on Linux 2.6.0/1
> > (they don't currently work at all).
>
> Please resubmit your patches as attachments or somehow otherwise
> teach your email client not to turn tabs into spaces as this corrupts
> your patches.

Sorry about that. Here are both patches attached (and in -p1 format this time
too)

patrick

diff -u linux-2.6.1.orig/net/decnet/af_decnet.c linux-2.6.1/net/decnet/af_decnet.c
--- linux-2.6.1.orig/net/decnet/af_decnet.c 2004-01-31 11:33:22.000000000 +0000
+++ linux-2.6.1/net/decnet/af_decnet.c 2004-01-31 11:34:30.000000000 +0000
@@ -163,7 +163,7 @@
struct dn_scp *scp = DN_SK(sk);

if (scp->addr.sdn_flags & SDF_WILD)
- return hlist_empty(&dn_wild_sk) ? NULL : &dn_wild_sk;
+ return hlist_empty(&dn_wild_sk) ? &dn_wild_sk : NULL;

return &dn_sk_hash[scp->addrloc & DN_SK_HASH_MASK];
}
diff -u linux-2.6.1.orig/net/decnet/dn_route.c linux-2.6.1/net/decnet/dn_route.c
--- linux-2.6.1.orig/net/decnet/dn_route.c 2003-12-18 02:59:42.000000000 +0000
+++ linux-2.6.1/net/decnet/dn_route.c 2004-01-31 11:34:38.000000000 +0000
@@ -1720,7 +1720,8 @@

static void dn_rt_cache_seq_stop(struct seq_file *seq, void *v)
{
- rcu_read_unlock();
+ if (v)
+ rcu_read_unlock();
}

static int dn_rt_cache_seq_show(struct seq_file *seq, void *v)