From patchwork Thu Jul 13 06:30:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9837767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2DC060392 for ; Thu, 13 Jul 2017 06:30:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D29E7283E7 for ; Thu, 13 Jul 2017 06:30:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C770F286BC; Thu, 13 Jul 2017 06:30:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58F2528665 for ; Thu, 13 Jul 2017 06:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751027AbdGMGae (ORCPT ); Thu, 13 Jul 2017 02:30:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:47455 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750949AbdGMGae (ORCPT ); Thu, 13 Jul 2017 02:30:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2E9C4AAF2; Thu, 13 Jul 2017 06:30:32 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Thu, 13 Jul 2017 16:30:05 +1000 Subject: [PATCH 1/4] mount: support compiling with old glibc Cc: linux-nfs@vger.kernel.org Message-ID: <149992740528.9181.13105862123992376333.stgit@noble> In-Reply-To: <149992731965.9181.6611555845253022123.stgit@noble> References: <149992731965.9181.6611555845253022123.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With glibc older than 2.24, it is always possible to include both linux/in6.h and netinet/in.h. So if the glibc is older, just hard-code the two values we need from linux/in6.h Signed-off-by: NeilBrown --- utils/mount/network.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/mount/network.c b/utils/mount/network.c index 281e9354a7fa..92457c726be7 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -39,7 +39,13 @@ #include #include #include -#include +#if defined(__GLIBC__) && (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24) +/* Cannot safely include linux/in6.h in old glibc, so hardcode the needed values */ +# define IPV6_PREFER_SRC_PUBLIC 2 +# define IPV6_ADDR_PREFERENCES 72 +#else +# include +#endif #include #include #include