Re: Unix-domain sockets - abstract addresses

Thunder from the hill (thunder@lightweight.ods.org)
Fri, 9 Aug 2002 16:33:18 -0600 (MDT)


Hi,

On Fri, 9 Aug 2002, Michael Procter wrote:
> --- af_unix.c.orig Fri Aug 9 14:10:05 2002
> +++ af_unix.c Fri Aug 9 14:17:38 2002

Well, if it's right, here goes the update:

--- linus-2.5/net/unix/af_unix.c Mon Aug 5 12:02:05 2002
+++ thunder-2.5/net/unix/af_unix.c Fri Aug 9 16:28:36 2002
@@ -79,6 +79,8 @@
* with BSD names.
*/

+#undef unix /* KBUILD_MODNAME */
+
#include <linux/module.h>
#include <linux/config.h>
#include <linux/kernel.h>
@@ -1114,9 +1116,7 @@

unix_state_rlock(sk);
if (!u->addr) {
- sunaddr->sun_family = AF_UNIX;
- sunaddr->sun_path[0] = 0;
- *uaddr_len = sizeof(short);
+ *uaddr_len = 0;
} else {
struct unix_address *addr = u->addr;

@@ -1400,7 +1400,8 @@
{
struct unix_sock *u = unix_sk(sk);

- msg->msg_namelen = sizeof(short);
+ msg->msg_namelen = 0;
+
if (u->addr) {
msg->msg_namelen = u->addr->len;
memcpy(msg->msg_name, u->addr->name, u->addr->len);

Thunder

-- 
--./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .-
--/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..-
.- -/---/--/---/.-./.-./---/.--/.-.-.-
--./.-/-.../.-./.././.-../.-.-.-

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