[CRIU] [PATCH 09/21] soccr: add support for half-closed sockets

Cyrill Gorcunov gorcunov at gmail.com
Mon Nov 28 13:08:30 PST 2016


On Mon, Nov 28, 2016 at 10:27:44PM +0300, Andrei Vagin wrote:
> From: Andrei Vagin <avagin at virtuozzo.com>
> 
> A socket is in one of half-closed states, if it sent a fin packet
> or it received a fin packet.
> 
> CRIU plays with fin packets to restore half-closed states too.
> 
> When we need to sent a fin packet from a socket, we can call
> shutdown(SHUT_WR). When a fin packet has to be restore in
> a received queue, criu generate a fin packet and send it via
> a raw ip socket.
> 
> A raw packet is sent with the SOCCR_MARK mark to be able
> to not block it.
> 
> Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> ---
>  criu/Makefile.packages |   2 +-
>  soccr/soccr.c          | 177 ++++++++++++++++++++++++++++++++++++++++++++++++-
>  soccr/soccr.h          |  11 ++-
>  3 files changed, 185 insertions(+), 5 deletions(-)
> 
> diff --git a/criu/Makefile.packages b/criu/Makefile.packages
> index 53fbdae..886394f 100644
> --- a/criu/Makefile.packages
> +++ b/criu/Makefile.packages
> @@ -19,7 +19,7 @@ REQ-DEB-PKG-NAMES	+= libcap-dev
>  
>  REQ-DEB-PKG-TEST-NAMES  += libaio-dev
>  
> -export LIBS		+= -lrt -lpthread -lprotobuf-c -ldl -lnl-3 -lsoccr -Lsoccr/
> +export LIBS		+= -lrt -lpthread -lprotobuf-c -ldl -lnl-3 -lsoccr -Lsoccr/ -lnet

A few comments if you don't mind:

 - lnet stands for some new external library, right? If so, should
   not we list it in REQ- packages above in Makefile, just to inform
   which package is needed (of course on top of this series)

 - if I understand correctly this library is needed only to build
   a few packets for sending via raw socket, maybe it would be easier
   simply get rid of this library and compose packages by hands
   (if yes, of course on top of the series too)


More information about the CRIU mailing list