From patchwork Thu Feb 14 10:24:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 158341 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1173050jaa; Thu, 14 Feb 2019 02:25:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IY7uUjdLakO5ihZhOkMZyE9d4z9pV725Gm7sNhewMk/O38QF2uAsHo4RcAwt4vv5pkmdMmw X-Received: by 2002:a17:902:5ac9:: with SMTP id g9mr3373091plm.205.1550139949640; Thu, 14 Feb 2019 02:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550139949; cv=none; d=google.com; s=arc-20160816; b=JgV5Q1OSUegiGHKVq2TBM7SzWNpYlDl1iB8UZcgbi6MfOG2j4j8u3LS8eYKXO8WMtW gNZNjd90ALtQgXQ8c0gLnCksE+BrguLCO3neMYihppH2tZywkrSG3C5u2ZoJSTlabIw/ 7nuoirQE+lVtfsKfKHhloQFMIuAh8xbEhip/7G3qS52TENQ2LvIggEnlYroGv3bhxH/1 xfJYVOhU2iUnrsiTqE7P/6d5g1MplK5WUUVnHDsdr4KtF11KQ81FtxFrbCRBRKjfSa7y tYkgPhP4uc5r3AbxYNuUg8+hurGNJNFey4/I2WJRBDXGiuOuTqvjQbBf18YXVssAPejG loFg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gvj8yj8XGaHNJ0qnaoRqnr716jerNytfzW/u9x/+UHc=; b=VDXMFODO3LLxHQcYS9TtQpvgsAyLAMN5SZ27ms6zXpnrY45iHb6AwgYyVPuRva3a5t HcnCIsOiMr642IF9gl9xM3J7UkZecnAH3yZwbAHMImFXQ9SKcUCIFZQJtJByQlJP9QcX 7OL235/EobGUd2oswQxVRgBVcRhoO7LR6AuW7fu3m5z8t62kaZa2ecfZwNTQQ5x+Z9pt m5McNcSpoLQ0/POuGFa6dpC/MnmjfWG/qeWuP81sCin1l13cd0kVJMV2okEOdnN/P+3h 68w6xhskves7g8VfE/IOrnbBQbJ21YOsy0wq6ELQcyN1Ky7PzPgXcptIZ3qWqU1vdGcI HnCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QO9ahHF0; 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 3si2132062plv.258.2019.02.14.02.25.49; Thu, 14 Feb 2019 02:25:49 -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=QO9ahHF0; 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 S2389001AbfBNKZt (ORCPT + 15 others); Thu, 14 Feb 2019 05:25:49 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41728 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388482AbfBNKZs (ORCPT ); Thu, 14 Feb 2019 05:25:48 -0500 Received: by mail-lj1-f193.google.com with SMTP id e17-v6so4737434lja.8 for ; Thu, 14 Feb 2019 02:25:47 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=gvj8yj8XGaHNJ0qnaoRqnr716jerNytfzW/u9x/+UHc=; b=QO9ahHF07kNDcRwcVep4gGMzK0z7KV7/T0D3yG9qCOyo5OCWl7d0TE4EOEcxWzGono YY5oKtvE27egKUYR3r5Q5Mk9Lk+nacA4ZbPpEvB9nrc+VyBHVFW8+jIC6uQteq/qU2us fXKk9KIuGjop+yJ6dna9xgfaVPiAkHe6ZL6ZsB5sTvC0mpauQ9K/lwLQhln3y79sJNV9 PeUvGbDkh9K2s0TQrQhuKLx99syJz0w2nF1JORGOAHQOQ9bRBsmBwaulJU6SKEk8rBqG Z7561fryUR3XJP07nb5oj2tmHClVrj26fHguwAinKZPUnpv7H6Wnwb9NxvAG5rConhQY OQeQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gvj8yj8XGaHNJ0qnaoRqnr716jerNytfzW/u9x/+UHc=; b=N7VR0AntyVJ2xaQbP9Q7o7M7ry6wJEn4QPFreG8IhWXTZZtkWHA2NZp3ENjwZhPHUV kfKm1rscp+YAjOE+AcVxQVF7X4pqjnu1M4PGRNXLHgwoLTNqQ1lTQP/hNDIVlNob+2bz lVG+yWPNBlUzQncGS/O24MpDCwywF1NK2yfxyynCNNhmvV2Y3XrzJtdR6eImltxpcUUb uREqtHSVabQk0WKLWZZljPj73EHWMV7hsvtgpRo5VoUt1KDtjWWQHQhlf80BaUnsWWH3 Jg7Wp7H65RidWi1CYyx1sBOD1mRLaL30uEONxHN6aSazRZN1PYI9BUQVG5v2m615YbYK DjwQ== X-Gm-Message-State: AHQUAuZdV4gLYpLIG6EOsyASDoILtUvyREYXBtZVOXg0v+FSL9dzWUte lyKKFVtRaupH4CaBi1Ge227WkA== X-Received: by 2002:a2e:7614:: with SMTP id r20-v6mr1881610ljc.175.1550139946783; Thu, 14 Feb 2019 02:25:46 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n189sm380392lfn.82.2019.02.14.02.25.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 02:25:45 -0800 (PST) From: Linus Walleij To: Greg Kroah-Hartman , stable@vger.kernel.org, openwrt-devel@lists.openwrt.org Cc: "David S . Miller" , Eric Dumazet , Hauke Mehrtens , Dave Taht , Liping Zhang , John Youn , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , James Hughes , Felix Fietkau Subject: [PATCH 10/10] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Thu, 14 Feb 2019 11:24:36 +0100 Message-Id: <20190214102436.5092-11-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214102436.5092-1-linus.walleij@linaro.org> References: <20190214102436.5092-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hauke Mehrtens 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 --- 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 659b1634de61..b31e2f836317 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h @@ -22,6 +22,7 @@ #define _UAPI_LINUX_IF_ETHER_H #include +#include /* * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble @@ -139,11 +140,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 774cb2db1b89..7c098d68d5e5 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -263,4 +263,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 */