From patchwork Thu Feb 14 12:27:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 158355 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1300574jaa; Thu, 14 Feb 2019 04:27:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IZvUespAqeWTBXcDXrVNLrl8RkPbFF6K2Sg3K0eGmd1IHkHmILMVVzDuymdV++az1O3JMsX X-Received: by 2002:a62:f5d7:: with SMTP id b84mr3804274pfm.36.1550147250744; Thu, 14 Feb 2019 04:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550147250; cv=none; d=google.com; s=arc-20160816; b=ENVoswYtQ8a8SGPpmBXkH7gFcxIJbttWYm0BdjWo1igCAGvMTn78Dcj/WRNo4DLXBQ c/trMVA/0CnerPZqaDJVujcbyTYXvDphIJ40t1H4ujY8glEy3Yc4QnuMEGVJTatd6baI CNcprXvIlMKo8ucSV5/hxcDPQEYo89nEWckFRB8YLfXa28w/1nQIigfI54EpM3vTWtyu dI8VX3uWgbFq8Kc27n0IjUb7va7oYoV1/lTkNCxOCNbk/UrOrTVYHrHqciU1ph58gLOE 8q+ie/B5poKeYFKiSshECkAVLOBcLzDEK96iG0BTpDAB7/w6W6HC8Ivo/t7b/iPbDjQB Hxag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MqAeGHvOWvIfxDTbhQ5LArgySs3EuUzvVxgZ/HDzuBg=; b=KAtZ0mBgNz7mfTBMQHQmWuJ8eBi7SVp2Lxo0OKelzRuKKHq8GRH4SFik77rxVtfPUk 2rZjftIcen3hnrWXXN17RwwDGFmGPnzEmBfF/yEG+xAM9COWj4pJtGlq/tc/s8qtsciH UUtSOTJDpiKHGvndm/U1z27JaZQFb4CdQC3waDnjqTvhJ7lv1zwfzo2nevPvjUeMfLMy v5fMYElkDvsO8YoVWglxzCMNImGIQ97UABHJgzy51Fr2mERuRSQAdzi9U2sfNUNNSGZB t9AF2HpjB7Sv1KsAMJF6zwvq0pbGTRVqFRtoK+8sgcjl8GN+mrmSjgBMd40HH7kbdQ1O EO4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h0d60DRA; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18si2228020pgh.335.2019.02.14.04.27.30; Thu, 14 Feb 2019 04:27:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h0d60DRA; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391819AbfBNM1a (ORCPT + 15 others); Thu, 14 Feb 2019 07:27:30 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46812 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727958AbfBNM13 (ORCPT ); Thu, 14 Feb 2019 07:27:29 -0500 Received: by mail-lj1-f196.google.com with SMTP id v16so5026757ljg.13 for ; Thu, 14 Feb 2019 04:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MqAeGHvOWvIfxDTbhQ5LArgySs3EuUzvVxgZ/HDzuBg=; b=h0d60DRAMOOt0GXi5Vnv5U8Uhk3NfWCttE84TN/+fmYLPoo+tG9l4sNaG/BB8/4lNQ 1RH7nDmzlC88ImIlIA/BtTEXagsQ2NtTtoqcx0yrrhoQrPWZK/26jQi9LPgetkOPTU3l jKre3BKeeVPrQbIsQiT97KPRIyKy3be8x7K7XCSqtM24VwIiaNPsDThACFzTEZEaOvy0 LsXhxTduEQadvVXlTf3PlOTm8+OQhSeyD6N7uXD0S5guD5n7s80xe73/7YLxaEv9982Y PVVanvcUIBoDvbbyU4XCHbFSfeAM3HXgdPo84vieYV4kAPK4B16jU80pf4cvqHC6eoxY DrEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MqAeGHvOWvIfxDTbhQ5LArgySs3EuUzvVxgZ/HDzuBg=; b=tZDHYqAl9uCBIZG6JSqjH33G3dV4ncPcbw66RMhOBl0JnagX64h9pHiqIdf5e/gV1t iXxqQdQ5tfELT1x4n0iO8ApMYBLtTydaYoS76Pv+C/zhiH17mRFNVKIAz6gyfkkItpwA I+yrFvlThr+vofswHAYwuDUbeq9k1600i4GUO7e2qNYhqH3RE1f2Z6vcss50GWibzKxP qVdtu8DuZCl1qk/3SJ5vLlvTXLxROAflplXeVyBeO+ujNJd6KzeVPB4lCwJjZumeo609 xlKOLgSVnkfvgeMVhAdAYusnNntzLT1BwVfDUrHIMTka/gjD0K8NvCT2l1JbvtIteUN2 U6Mg== X-Gm-Message-State: AHQUAuaBxIYppDyDOscfPUBv7za1dcFRfxO/j0wr+gqsgiiPImmLdGU9 vmyWp/4vzwgfCWB+uDDh6yGH9A== X-Received: by 2002:a2e:2007:: with SMTP id g7mr2306958ljg.93.1550147247996; Thu, 14 Feb 2019 04:27:27 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g67-v6sm413187lje.62.2019.02.14.04.27.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 04:27:27 -0800 (PST) From: Linus Walleij To: Greg Kroah-Hartman , stable@vger.kernel.org, openwrt-devel@lists.openwrt.org Cc: "David S . Miller" , Hauke Mehrtens Subject: [PATCH] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Thu, 14 Feb 2019 13:27:20 +0100 Message-Id: <20190214122720.27172-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hauke Mehrtens commit 6926e041a8920c8ec27e4e155efa760aa01551fd upstream. Musl provides its own ethhdr struct definition. Add a guard to prevent its definition of the appropriate musl header has already been included. glibc does not implement this header, but when glibc will implement this they can just define __UAPI_DEF_ETHHDR 0 to make it work with the kernel. Signed-off-by: Hauke Mehrtens Signed-off-by: David S. Miller --- - This is upstream in v4.15 - This should be applied for stable v4.14.y and v4.9.y --- include/uapi/linux/if_ether.h | 3 +++ include/uapi/linux/libc-compat.h | 6 ++++++ 2 files changed, 9 insertions(+) -- 2.20.1 diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 244e3213ecb0..60ec9114e28f 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h @@ -23,6 +23,7 @@ #define _UAPI_LINUX_IF_ETHER_H #include +#include /* * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble @@ -150,11 +151,13 @@ * This is an Ethernet frame header. */ +#if __UAPI_DEF_ETHHDR struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ __be16 h_proto; /* packet type ID field */ } __attribute__((packed)); +#endif #endif /* _UAPI_LINUX_IF_ETHER_H */ diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index 8254c937c9f4..fc29efaa918c 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -264,4 +264,10 @@ #endif /* __GLIBC__ */ +/* Definitions for if_ether.h */ +/* allow libcs like musl to deactivate this, glibc does not implement this. */ +#ifndef __UAPI_DEF_ETHHDR +#define __UAPI_DEF_ETHHDR 1 +#endif + #endif /* _UAPI_LIBC_COMPAT_H */