From patchwork Mon May 15 09:18:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lebrun X-Patchwork-Id: 762329 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wRFP408Wsz9s4s for ; Mon, 15 May 2017 19:18:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=uclouvain.be header.i=@uclouvain.be header.b="dsZAEFRM"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933724AbdEOJSN (ORCPT ); Mon, 15 May 2017 05:18:13 -0400 Received: from smtp.sgsi.ucl.ac.be ([130.104.5.67]:49916 "EHLO smtp1.sgsi.ucl.ac.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756829AbdEOJSL (ORCPT ); Mon, 15 May 2017 05:18:11 -0400 Received: from mailboxes.uclouvain.be (mailboxes.uclouvain.be [130.104.6.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.sgsi.ucl.ac.be (Postfix) with ESMTPS id 0414F67DC04; Mon, 15 May 2017 11:18:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 smtp1.sgsi.ucl.ac.be 0414F67DC04 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uclouvain.be; s=selucl; t=1494839881; bh=KSVdy0l0UuwHFw+bBwV/6DzDqHBeE3kfuCnGIdmBfmE=; h=From:To:CC:Subject:Date; b=dsZAEFRMhOoPlB33dfhkJTk01Xs0sBUaplCk9HLTcCTdqbSZNCPaszoQRTgCeS78u htROjnFErZ/eNLqyznrO5CR9aRO0IUiOY2Ni3qMKDMQzXEQF1rxmNMwmUaa1m8MhDG HCT9ZDmEObkKJGyrg6J7LjNqpWCgGBvZX3ytM3pw= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99.2 at smtp-1 Received: from localhost.localdomain (130.104.228.78) by ucl-mbx04.OASIS.UCLOUVAIN.BE (10.10.10.24) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 15 May 2017 11:18:00 +0200 From: David Lebrun To: CC: , David Lebrun Subject: [PATCH net] ipv6: sr: fix user space compilation error with old glibc Date: Mon, 15 May 2017 11:18:28 +0200 Message-ID: <20170515091828.19349-1-david.lebrun@uclouvain.be> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 X-Originating-IP: [130.104.228.78] X-ClientProxiedBy: UCL-CAS03.OASIS.UCLOUVAIN.BE (10.10.10.43) To ucl-mbx04.OASIS.UCLOUVAIN.BE (10.10.10.24) X-SGSI-Information: X-SGSI-MailScanner-ID: 0414F67DC04.A7513 X-SGSI-MailScanner: Found to be clean X-SGSI-SpamCheck: n'est pas un polluriel, SpamAssassin (not cached, score=-4.001, requis 5, autolearn=not spam, ALL_TRUSTED -2.00, BAYES_00 -1.90, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, RP_MATCHES_RCVD -0.00) X-SGSI-From: david.lebrun@uclouvain.be X-SGSI-Spam-Status: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When seg6.h is included in a user space program that also includes netinet/in.h, it results in multiple definitions of structures such as struct in6_addr. Recent glibc versions have a workaround that consists in defining __USE_KERNEL_IPV6_DEFS to prevent duplicates. However, such a program will fail to compile with older glibc versions. This patch ensures that including seg6.h will work in any case. Fixes: ea3ebc73b46fbdb049dafd47543bb22efaa09c8e ("uapi: fix linux/seg6.h and linux/seg6_iptunnel.h userspace compilation errors") Reported-by: Daniel Borkmann Signed-off-by: David Lebrun --- include/uapi/linux/seg6.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/uapi/linux/seg6.h b/include/uapi/linux/seg6.h index 7278511..52b8f46 100644 --- a/include/uapi/linux/seg6.h +++ b/include/uapi/linux/seg6.h @@ -15,7 +15,16 @@ #define _UAPI_LINUX_SEG6_H #include + +#ifdef __KERNEL__ #include /* For struct in6_addr. */ +#else +#ifdef __USE_KERNEL_IPV6_DEFS +#include +#else +#include +#endif +#endif /* * SRH