netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* non-symmetric Unix dgram sockets and poll
@ 2011-02-02 17:36 Alban Crequy
  2011-02-03  8:45 ` Rémi Denis-Courmont
  0 siblings, 1 reply; 2+ messages in thread
From: Alban Crequy @ 2011-02-02 17:36 UTC (permalink / raw)
  To: netdev

Hi,

I have 3 Unix dgram sockets (sockA, sockB, sockC):
- sockA is connected to sockB.
- sockB is connected to sockC.
- sockC is not connected.

SockA cannot send any message to sockB because net/unix/af_unix.c::unix_may_send()
prevents it. Is there any reason for that restriction?

If it was possible to send that message, unix_dgram_poll() on sockB could be in a
situation where it needs to add the current process in 2 different wait queues:
- sk_sleep(sk) for POLLIN (messages coming from sockA)
- &unix_sk(other)->peer_wait for POLLOUT (to send messages to sockC)

Is it correct?

Thanks,
Alban

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

* Re: non-symmetric Unix dgram sockets and poll
  2011-02-02 17:36 non-symmetric Unix dgram sockets and poll Alban Crequy
@ 2011-02-03  8:45 ` Rémi Denis-Courmont
  0 siblings, 0 replies; 2+ messages in thread
From: Rémi Denis-Courmont @ 2011-02-03  8:45 UTC (permalink / raw)
  To: netdev

Le mercredi 2 février 2011 19:36:40 Alban Crequy, vous avez écrit :
> Hi,
> 
> I have 3 Unix dgram sockets (sockA, sockB, sockC):
> - sockA is connected to sockB.
> - sockB is connected to sockC.
> - sockC is not connected.
> 
> SockA cannot send any message to sockB because
> net/unix/af_unix.c::unix_may_send() prevents it. Is there any reason for
> that restriction?

Yes, absolutely. When you connect() a socket, you expect to only *receive* 
packets from the specified peer.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis

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

end of thread, other threads:[~2011-02-03  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 17:36 non-symmetric Unix dgram sockets and poll Alban Crequy
2011-02-03  8:45 ` Rémi Denis-Courmont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).