From patchwork Mon Sep 16 13:21:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1162807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46X6N314FRz9sPl; Mon, 16 Sep 2019 23:21:55 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i9qwv-0002te-Ax; Mon, 16 Sep 2019 13:21:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i9qwu-0002tY-4e for kernel-team@lists.ubuntu.com; Mon, 16 Sep 2019 13:21:48 +0000 Received: from mail-wm1-f71.google.com ([209.85.128.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i9qwt-00026H-SO for kernel-team@lists.ubuntu.com; Mon, 16 Sep 2019 13:21:47 +0000 Received: by mail-wm1-f71.google.com with SMTP id 124so9744wmz.1 for ; Mon, 16 Sep 2019 06:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=POzVBtpetRSzG7zQoKX5IkeYwAGUuxgXpPPmQGBpKoU=; b=XtQvWJIkABf51kuxikDMe34hbhlUvuXlv4xhl/HKNQbs7kEUivoF1IaVXqgf3jOisA WEVDAFn24pM01NeZkUOzBGVMhZZBmd5dKv+JpOtBqMsbzRKb9/WtHS79Gv2XxmB9v3ZC DiKkN3P8RoeNJCxM1ehs5UE4PyLYaJ+nCAiYMJOvb4bYVXY2aBzTagc71qn0uRlkoMTF soKm2CkUXtA7tkQEkEId4+p9J3xd5C7v9Lez43WXdP6kSDL2O93mad/LcntAu3DPN3nd ZLxbjJOuuYy1/9v/1e4ld3xIhPdiBl8kMpm2LiqvHA2UieBjj+hbvzESVO1hY+3w6QmB bGKQ== X-Gm-Message-State: APjAAAUBUUWt055qTxeA/Dh5tT89z/PnAh86NtgiW99uABGg6fuA51j1 f3uvHgOiht6TiDVM5/b87X3FxNz5VFxUeH5aeixAm1YyJ/J1atP5lHtphGm3iu4/g+mGFvMqFaX eM7/mIZoB4R3sPniKWCUnatCrXtebpU7zWkzW/5OE X-Received: by 2002:a5d:494d:: with SMTP id r13mr8545772wrs.166.1568640107270; Mon, 16 Sep 2019 06:21:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhQsjmkBtDBcGIH8eI3VDpVJuPIOWxY3UZ+Ox9yAICrGDJuTqxA9NaOzKdRtek94htF/WcCg== X-Received: by 2002:a5d:494d:: with SMTP id r13mr8545752wrs.166.1568640106920; Mon, 16 Sep 2019 06:21:46 -0700 (PDT) Received: from localhost.localdomain (static-dcd-cqq-121001.business.bouyguestelecom.com. [212.194.121.1]) by smtp.gmail.com with ESMTPSA id x6sm18665244wmf.38.2019.09.16.06.21.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 06:21:46 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [bionic:linux][PATCH] UBUNTU: SAUCE: selftests: net: replace AF_MAX with INT_MAX in socket.c Date: Mon, 16 Sep 2019 10:21:45 -0300 Message-Id: <20190916132145.26170-1-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1842023 Use INT_MAX instead of AF_MAX, since libc might have a smaller value of AF_MAX than the kernel, what causes the test to fail. Signed-off-by: Marcelo Henrique Cerri Acked-by: Thadeu Lima de Souza Cascardo Acked-by: Stefan Bader --- Usually this issue will only occur with backport kernels (such as hwe) since the glibc headers need to be older than the kernel for this test to fail. Apply the fix to the generic kernel though so we can ensure that all derivatives actually include it. --- tools/testing/selftests/net/socket.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/socket.c b/tools/testing/selftests/net/socket.c index afca1ead677f..10e75ba90124 100644 --- a/tools/testing/selftests/net/socket.c +++ b/tools/testing/selftests/net/socket.c @@ -6,6 +6,7 @@ #include #include #include +#include struct socket_testcase { int domain; @@ -24,7 +25,10 @@ struct socket_testcase { }; static struct socket_testcase tests[] = { - { AF_MAX, 0, 0, -EAFNOSUPPORT, 0 }, + /* libc might have a smaller value of AF_MAX than the kernel + * actually supports, so use INT_MAX instead. + */ + { INT_MAX, 0, 0, -EAFNOSUPPORT, 0 }, { AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 1 }, { AF_INET, SOCK_DGRAM, IPPROTO_TCP, -EPROTONOSUPPORT, 1 }, { AF_INET, SOCK_DGRAM, IPPROTO_UDP, 0, 1 },