All of lore.kernel.org
 help / color / mirror / Atom feed
* Unix-domain sockets - abstract addresses
@ 2002-08-08 16:15 Michael Procter
  2002-08-08 18:36 ` kuznet
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Procter @ 2002-08-08 16:15 UTC (permalink / raw)
  To: linux-kernel

I have been trying to use unix domain datagram sockets in an application,
but have found what appears to be an inconsistency between the kernel and
the manpage unix(7).

I have a server, which creates a socket, binds it to an address and then
does a recvfrom().  When it gets a packet, it tries to respond with
sendto(), supplying the address information from the recvfrom() call.

All this works fine when the client binds it's socket to an address in the
filesystem before issuing the connect().  But I don't want another
filesystem entity, so I am trying to use an address in the abstract
namespace.

Abstract addresses work fine when the client calls bind() with an address
length of 2, and also if it sets the socket option SO_PASSCRED before
connect().  But if the client does neither and simply calls connect(),
the server gets an invalid 'from' address (address family usually zero,
but I have seen 0x0BA5, 0x7FA8, 0x1FA8 and others).

According to the man page 'unix(7)':
When a socket is connected and it doesn't already have a local address a
unique address in the abstract namespace will be generated automatically.

So, the question is:  which is right?  The man page, or af_unix.c?

I have been doing my tests on 2.4.9-34 (RedHat 7.2), but looking at 2.4.19
from kernel.org, the results should be the same.

Regards,

Michael Procter

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2002-08-12 14:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-08 16:15 Unix-domain sockets - abstract addresses Michael Procter
2002-08-08 18:36 ` kuznet
2002-08-09  0:29   ` Thunder from the hill
2002-08-09 13:52   ` Michael Procter
2002-08-09 16:15     ` kuznet
2002-08-09 22:33     ` Thunder from the hill
2002-08-10  1:05       ` David S. Miller
2002-08-10  1:35         ` Keith Owens
2002-08-10  1:41           ` David S. Miller
2002-08-10  2:19             ` Keith Owens
2002-08-10  2:15               ` David S. Miller
2002-08-10 10:59               ` Roman Zippel
2002-08-12  2:35               ` Oliver Xymoron
2002-08-12  2:59                 ` Keith Owens
2002-08-12  2:59                   ` David S. Miller
2002-08-12  3:20                     ` Keith Owens
2002-08-12  3:13                       ` David S. Miller
2002-08-12  3:57                         ` Keith Owens
2002-08-12  7:13                           ` Eric W. Biederman
2002-08-12 14:28                           ` David Woodhouse
2002-08-10  6:29         ` Thunder from the hill

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.