All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH 4/4] Handle unconnected DGRAM sockets with buffers in-flight
Date: Thu, 13 Aug 2009 17:00:08 -0400	[thread overview]
Message-ID: <4A847ED8.9050001@librato.com> (raw)
In-Reply-To: <87my63phwp.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>



Dan Smith wrote:
> OL> Hmm.. I think this would break recvfrom() syscall: it eventually
> OL> calls unix_dgram_recvmsg(), which grabs the next skb (datagram) in
> OL> the queue, and fills in the address of the socket from which the
> OL> datagram had been sent (af_unix.c:1672)
> 
> Why would that be any different from the normal case of sending from
> an unbound socket to a process receiving with recvfrom()?

The recvfrom() would give wrong result (compared to original execution)
unless the correct socket-of-origin is used.

> 
> OL> 	if (msg->msg_name)
> OL> 		unix_copy_addr(msg, skb->sk);
> 
> If you look at unix_copy_addr() it bails if !sk->addr.
> 
> OL> The more I think about it, it seems better to also checkpoint
> OL> those unconnected sockets that are the source of dgrams. IOW, when
> OL> looping through the received skb's of an unconnected dgram socket,
> OL> then check the skb->sk of each pending packet, and checkpoint that
> OL> socket too.
> 
> That will, IMHO, make the restore process a little uglier.  I was
> thinking more along the lines of saving the address of the skb's
> sender (if needed) and doing something like a temporary bind of the
> peer before sending the buffer on restore.
> 

This would mean one socket for all skb's (dgrams), so one address
for all of them. So one result for recvfrom() on restored system
vs multiple different addresses on original system.

Oren.

      parent reply	other threads:[~2009-08-13 21:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13 19:29 Socket c/r additional features Dan Smith
     [not found] ` <1250191750-3864-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 19:29   ` [PATCH 1/4] Set socket flags on restore using sock_setsockopt() where possible Dan Smith
     [not found]     ` <1250191750-3864-2-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 19:44       ` Oren Laadan
     [not found]         ` <4A846D0E.90607-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-13 19:55           ` Dan Smith
2009-08-13 22:07       ` Serge E. Hallyn
2009-08-13 19:29   ` [PATCH 2/4] Expose may_setuid() in user.h Dan Smith
     [not found]     ` <1250191750-3864-3-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 22:28       ` Serge E. Hallyn
     [not found]         ` <20090813222837.GB13219-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 23:11           ` Serge E. Hallyn
2009-08-14  0:52       ` Serge E. Hallyn
2009-08-13 19:29   ` [PATCH 3/4] Save and restore UNIX socket peer credentials Dan Smith
     [not found]     ` <1250191750-3864-4-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 23:17       ` Serge E. Hallyn
2009-08-13 19:29   ` [PATCH 4/4] Handle unconnected DGRAM sockets with buffers in-flight Dan Smith
     [not found]     ` <1250191750-3864-5-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-13 20:33       ` Oren Laadan
     [not found]         ` <4A8478B4.2070207-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-13 20:39           ` Dan Smith
     [not found]             ` <87my63phwp.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-08-13 21:00               ` Oren Laadan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A847ED8.9050001@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.