Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2428479imj; Mon, 18 Feb 2019 05:57:21 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmaTlpIvtP2xYb4hBniJEJGPlX9hOlJqLRGKe+bD/VtXdmMCyutipFXdXJiZyFqDPynbj6 X-Received: by 2002:a63:f253:: with SMTP id d19mr18958292pgk.14.1550498241490; Mon, 18 Feb 2019 05:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498241; cv=none; d=google.com; s=arc-20160816; b=XKU0yM8IzmNwj8QVchDlZr7QGpKVBZa18fyH8kn5BDmdOnQtAGmrDzzLzJi4gbg/qA 41QMqzMM5AQN+D87R2L7z+yefQXOn+dXSYtaveF7r3AGdvKsxIYkgE62hBM49xWkNgfR wBoD/9xo5jSb7OB50bwEfBzckNsrCMm6lYwyX6ZLC1oecNHt1aH0nVy7D1lj0ZU9KTBv bnE+thm6hshTeZaO2+ZZfEN1hjE+gDdn3rWZObGtNpDBZ8imxPfw46utdL1mvdg7JVjE KOHwhHqOD416sc2/iqEEfXKtuN1Ko8MQ4+tnX58DH9mmcu/zoFq1SC+nkrlZC0RfbOlv 4OjA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lDAoAo+a5GacfVP4ydWDv9+atZQAIEaVvHn7Jc792VU=; b=TlOM2kgsRMV7tKR+DP+EDWp0j5Hahkr2cu/HeCInB4j6kxR4gha2p5AzYWfgmmqBxv pPyWegmDerkzVvlg5YS7GF22Bdm2YhvvGd0s3so2fgchk9AoYYE3jv9apmrz+QK5FsaA K09C++NPDtS3SKqIRRFrq6DbQC3Yohm9yaAvXuHg64yiDvCXAXG9ZSqlTCORdaP8JoEv cAH+qRrUSk2wmx4FUwI6KHqZ9+3oMDYhYbujY7wBUYdEv2FnK1lFxkN1VD61XzuUqNDw adbm2AqhwdYzQLjX08ziaR6K/LibkLf2ofdo3QWV4HE3bemVM98W5SwA1rEfLjyVO/OA pE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e0HkOvPe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si14054547plr.419.2019.02.18.05.57.06; Mon, 18 Feb 2019 05:57:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=e0HkOvPe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387426AbfBRNzA (ORCPT + 99 others); Mon, 18 Feb 2019 08:55:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:34982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387414AbfBRNy7 (ORCPT ); Mon, 18 Feb 2019 08:54:59 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 007F82077B; Mon, 18 Feb 2019 13:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498098; bh=y28mxSDhRUEhQeLAu/Xp4d/xE1cJ6D61D2rm7ZHH0QA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e0HkOvPeNEaHLiiRgzEEOACTtqoDoDn5TN2y/qUGta8ClfLcdBXVz4TRwwaPIw7qn nTR1LKu9teEcv3wdLqpv65VtKOobeCWHxnMGFazwwxZ3XIXuhZbbILSKl65k9hNel6 GSplcorOwVg35oiISLxpm8KlRMd6uc7dkjtSBXjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hauke Mehrtens , "David S. Miller" , Linus Walleij , Sasha Levin Subject: [PATCH 4.14 04/62] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Mon, 18 Feb 2019 14:43:10 +0100 Message-Id: <20190218133506.144278426@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- include/uapi/linux/if_ether.h | 3 +++ include/uapi/linux/libc-compat.h | 6 ++++++ 2 files changed, 9 insertions(+) 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 */ -- 2.19.1