Bug or dead code in net/unix/af_unix.c:unix_mkname()

From: James Antill
Date: Mon Oct 11 2004 - 13:11:10 EST



unix_mkname() looks like (in both 2.4.x and 2.6.x)...

static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp)
{
if (len <= sizeof(short) || len > sizeof(*sunaddr))
return -EINVAL;
[...]
if (len > sizeof(*sunaddr))
len = sizeof(*sunaddr);


...so if you pass a "large" sockaddr_un struct bind() just returns
-EINVAL. I assume that is intentional, but that just makes the huge
comment and test later dead code.

--
James Antill
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/