soccr: Print errors in send_fin

Submitted by Pavel Emelianov on April 3, 2017, 6:09 p.m.

Details

Message ID 58E28FC6.8060205@virtuozzo.com
State New
Series "soccr: Print errors in send_fin"
Headers show

Commit Message

Pavel Emelianov April 3, 2017, 6:09 p.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>

---
 soccr/soccr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/soccr/soccr.c b/soccr/soccr.c
index 70f9935..fda602e 100644
--- a/soccr/soccr.c
+++ b/soccr/soccr.c
@@ -564,11 +564,15 @@  static int send_fin(struct libsoccr_sk *sk, struct libsoccr_sk_data *data,
 		libnet_type,		/* injection type */
 		NULL,			/* network interface */
 		errbuf);		/* errbuf */
-	if (l == NULL)
+	if (l == NULL) {
+		loge("libnet_init failed (%s)\n", errbuf);
 		return -1;
+	}
 
-	if (setsockopt(l->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)))
+	if (setsockopt(l->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark))) {
+		loge("Can't set SO_MARK (%d) for socket\n", mark);
 		goto err;
+	}
 
 	ret = libnet_build_tcp(
 		ntohs(sk->dst_addr->v4.sin_port),		/* source port */

Comments

Pavel Emelianov April 3, 2017, 9:16 p.m.
On 04/03/2017 11:45 PM, Patchwork wrote:
> == Series Details ==
> 
> Series: soccr: Print errors in send_fin
> URL   : https://patchwork.criu.org/series/1419/
> State : failure
> 
> == Logs ==
> 
> For more details see: https://travis-ci.org/criupatchwork/criu/builds/218178790

ENOSPC on Alpine build :\
Andrey Vagin April 3, 2017, 11:39 p.m.
On Mon, Apr 03, 2017 at 09:09:10PM +0300, Pavel Emelyanov wrote:
> 
> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
> 
> ---
>  soccr/soccr.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/soccr/soccr.c b/soccr/soccr.c
> index 70f9935..fda602e 100644
> --- a/soccr/soccr.c
> +++ b/soccr/soccr.c
> @@ -564,11 +564,15 @@ static int send_fin(struct libsoccr_sk *sk, struct libsoccr_sk_data *data,
>  		libnet_type,		/* injection type */
>  		NULL,			/* network interface */
>  		errbuf);		/* errbuf */
> -	if (l == NULL)
> +	if (l == NULL) {
> +		loge("libnet_init failed (%s)\n", errbuf);
>  		return -1;
> +	}
>  
> -	if (setsockopt(l->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)))
> +	if (setsockopt(l->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark))) {
> +		loge("Can't set SO_MARK (%d) for socket\n", mark);

you need to use logerr to print errno

>  		goto err;
> +	}
>  
>  	ret = libnet_build_tcp(
>  		ntohs(sk->dst_addr->v4.sin_port),		/* source port */
> -- 
> 2.5.5
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu