From patchwork Fri Dec 13 16:38:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 1209289 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="C1N4BAAZ"; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ZGZP0mz1z9sPn for ; Sat, 14 Dec 2019 03:38:37 +1100 (AEDT) Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E7C471011369B; Fri, 13 Dec 2019 08:41:57 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=205.139.110.120; helo=us-smtp-1.mimecast.com; envelope-from=dcaratti@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A510410113692 for ; Fri, 13 Dec 2019 08:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576255112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aKImi+H5OyRwV+jKy8LdvIHSC++dWxlME48o9ttW+48=; b=C1N4BAAZSo58VwT8c5HQTN9nl8JPOgkhjRWQ/91Og/O3Dw+YpWSIepqbObcRywsKT0BUL4 2aIZ7Iysuz7lZJkp4FEOcFGIYDWdHWE1K35edULYWBAMYKQNjFJOBrhgcdq34nBpRaeSqL ZiaTaHEPyzuQF15FK1+C92/AS2J1IWg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-lnArYjSJNsSbf6f4Ku-QPw-1; Fri, 13 Dec 2019 11:38:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D7A11005502 for ; Fri, 13 Dec 2019 16:38:30 +0000 (UTC) Received: from new-host-5.redhat.com (ovpn-205-190.brq.redhat.com [10.40.205.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF95E5C241 for ; Fri, 13 Dec 2019 16:38:29 +0000 (UTC) From: Davide Caratti To: mptcp@lists.01.org Date: Fri, 13 Dec 2019 17:38:24 +0100 Message-Id: <7e3bd531e4e10878c9fb009595a4721d77c6993c.1576255051.git.dcaratti@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: lnArYjSJNsSbf6f4Ku-QPw-1 X-Mimecast-Spam-Score: 0 Message-ID-Hash: 7JKESOM62IGYA25HI24GSA4DNXD5MKBW X-Message-ID-Hash: 7JKESOM62IGYA25HI24GSA4DNXD5MKBW X-MailFrom: dcaratti@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH v2] squash-to: "mptcp: add basic kselftest for mptcp" List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: checkpatch fixes Signed-off-by: Davide Caratti --- .../selftests/net/mptcp/mptcp_connect.c | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index 8b8718e150d1..a3dccd816ae4 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -71,7 +71,8 @@ static void xgetnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *serv, socklen_t servlen) { int flags = NI_NUMERICHOST | NI_NUMERICSERV; - int err = getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags); + int err = getnameinfo(addr, addrlen, host, hostlen, serv, servlen, + flags); if (err) { const char *errstr = getxinfo_strerr(err); @@ -161,7 +162,6 @@ static int sock_listen_mptcp(const char * const listenaddr, static bool sock_test_tcpulp(const char * const remoteaddr, const char * const port) { - struct addrinfo hints = { .ai_protocol = IPPROTO_TCP, .ai_socktype = SOCK_STREAM, @@ -281,11 +281,12 @@ static ssize_t do_rnd_read(const int fd, char *buf, const size_t len) static void set_nonblock(int fd) { - int flags = fcntl(fd, F_GETFL); - if (flags == -1) - return; + int flags = fcntl(fd, F_GETFL); + + if (flags == -1) + return; - fcntl(fd, F_SETFL, flags | O_NONBLOCK); + fcntl(fd, F_SETFL, flags | O_NONBLOCK); } static int copyfd_io_poll(int infd, int peerfd, int outfd) @@ -478,7 +479,7 @@ static int do_sendfile(int infd, int outfd, unsigned int count) } static int copyfd_io_mmap(int infd, int peerfd, int outfd, - unsigned int size) + unsigned int size) { int err; @@ -501,7 +502,6 @@ static int copyfd_io_mmap(int infd, int peerfd, int outfd, return err; } - static int copyfd_io_sendfile(int infd, int peerfd, int outfd, unsigned int size) { @@ -575,11 +575,11 @@ static void check_sockaddr(int pf, struct sockaddr_storage *ss, if (salen != wanted_size) fprintf(stderr, "accept: size mismatch, got %d expected %d\n", - (int)salen, wanted_size); + (int)salen, wanted_size); if (ss->ss_family != pf) fprintf(stderr, "accept: pf mismatch, expect %d, ss_family is %d\n", - (int)ss->ss_family, pf); + (int)ss->ss_family, pf); } static void check_getpeername(int fd, struct sockaddr_storage *ss, socklen_t salen) @@ -746,15 +746,13 @@ int parse_sndbuf(const char *size) if (errno) { fprintf(stderr, "Invalid sndbuf size %s (%s)\n", - size, - strerror(errno)); + size, strerror(errno)); die_usage(); } if (s > INT_MAX) { fprintf(stderr, "Invalid sndbuf size %s (%s)\n", - size, - strerror(ERANGE)); + size, strerror(ERANGE)); die_usage(); }