Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2442229imj; Mon, 18 Feb 2019 06:08:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IaHPZRIlJUw7K3FDRg4yNOE4KMPHhTFizv7DAv1NZ/AZNAvzVi+dUNNuXDIsKJQuAwx3uTV X-Received: by 2002:a17:902:b287:: with SMTP id u7mr17097215plr.69.1550498936279; Mon, 18 Feb 2019 06:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498936; cv=none; d=google.com; s=arc-20160816; b=JUCyRPOsIKgdtoBZY0w3MNx1ZF5m7orxO9Iaoh2LBAFfL+R63zSOEtTHwEn0YPM4g8 W6yXKSHxlcAVE6XnIHOgnVx2M87LyglEaz/0Qn7xRkFXqWYu0bSHGB7POY15MaGQF0EV +inX8XScjT2KLM5ETXoWdy1uIdNAZRxH5yiZGc5Yd4pWpgqpAr3o+hFNC3tjuTv1SuMT qaTKZj33+ux+RbkzCAt+pNltqmZV7pjKiwqmwdttbKKhccPVJvLWi1QAt9qrqHVXq+AG abKPR3Xe1alYhrZDILSWh5vgC7bqcQdxBAtw7v3iXqojKnyO9ZvSMIIyOPF2pZEnxDbh aplA== 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=lUeao+soMapkrMGtaqMFq5g2uFOYmZ7uHKkZT3ROASU=; b=r7Pyos3+d4W7l2qMZ/dI9RqCFYnkaGUURBLBHJJq2qo+g7AzmhVZ1EzUAPUtPE0uHH S4Fh4P0iPp7EFiK+VMW8FqbZtxYhyYH70rUoTXfl246VIbKpGMu3Q6R9q1Iyb03Tfx+0 C1C4KMfVyuhEG9125hcKJfus1SoRepfY/5cDAS6nsa98ViCLcEvfQWMMUZXEl3mwWP3u rGZP3AO0TRUWiapICXNyttZq5afxG5AEb/4KHq1HRF+yz3tF6Y0xMP/EJq2JPJjxYY+X pRTgcE+RS1+ZIiUC1EQWTBG/WGZ7SLkVwilOjY+Bbs/A8zlhxRc4mMHzEU3n9uboOZBh j5sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1PNqOWyu; 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 k1si3552866pls.208.2019.02.18.06.08.40; Mon, 18 Feb 2019 06:08:56 -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=1PNqOWyu; 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 S2389784AbfBROG2 (ORCPT + 99 others); Mon, 18 Feb 2019 09:06:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:49476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390387AbfBROGY (ORCPT ); Mon, 18 Feb 2019 09:06:24 -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 09584204FD; Mon, 18 Feb 2019 14:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498783; bh=m51NO63qifD/N2cT38M9UoVF7mAcHTaA48h/zT/arCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1PNqOWyuR0nocwSzH7hdxN7j03jJfRjK90Ic4Gu4Ypb2KZdBLnbmrP6AaZ2lyV1g4 mNR20ZuTR5zu/mJRon8GO3b8o9FNhlnmO8gqjtmWyUgeLpHJn3/n0cdBK856GsBybS dLo2lYi7mpSzNGDa7TXls8/D//h0XKUWbT0RACdA= 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.4 119/143] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Mon, 18 Feb 2019 14:44:07 +0100 Message-Id: <20190218133533.355474548@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@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.4-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 064d2026ab38..cb490cd9376f 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 @@ -136,11 +137,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 e4f048ee7043..5da44c571cdd 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -184,4 +184,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