Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2430142imj; Mon, 18 Feb 2019 05:59:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IZaPQDWFLVFIF6bhiOUTeRLb9k9uo8r3rzFsi/aMz/L4TacvHQQw9KIxQCcF7CUlFAfnVaz X-Received: by 2002:a17:902:9885:: with SMTP id s5mr25858660plp.52.1550498356443; Mon, 18 Feb 2019 05:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498356; cv=none; d=google.com; s=arc-20160816; b=wbHR1tbyDZn+VgO2i1jTtU0y77JAvf7wQVO/Dc6dv3L0diCT7tFNAqrCyE3moylTjt 8fnE8Okx8TmkJLiW+PROfLyPTSd1WAEJHNuxWrFK/bD6OS+COoAU5r9texn8wmN3xNZo U2MctAcsIn70t0nZJ96DPbpVe60gCvNtHNSs4u8pMQhizEOAoXuOEOJ+gujPD5gwZG1I XEHFSuCcugWrLvkxJwfBR+6AosmgxT1J9J6afNK27FpGcsGWar/E/MaN+89i9ABIMdPN iGLAKyOzxl/Kz5ohDcAOlSIBMU9Sit0527nyGP3lShuh/UEJyyJlUW0NwihZe6YbYW/V tOcg== 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=UqlpotqG28ypqRzg+jzRbfFrcFH0hWNUyZ/wZw/a27Y=; b=n/JtoaSAagCV7sw3hfg3zLbcK8KWRRJSUV97IUOaRCmIuzHgNrCQRZcJhnCQCEFDdi dQHfAkKMZysgwAJlkuTuam2c5xVFbYMD+WnLlNvhOdAD0GvXn05yL0kaUkllJL6BD3qb CnjEWKKlpoGiUMUhndk7Nq20IYnMwrH9++Y2RJttsvCWLvMmQ5xDP+Hb5zqC0WiDZHz2 JqqnLJDqZpaEOcWrzfpFX89kM9mo7PYjxF5+XFODLTb5HxF0gAfSNwxfuJpmHzZueaf7 +dqnmwbmjwP4qQ0Be59RatfRCVPkHCBvesbMJCarw2s2bL+ll6zaQeqQeGQvdIcoFJuR Qy0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kZrIYB/s"; 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 e125si12343557pgc.411.2019.02.18.05.59.00; Mon, 18 Feb 2019 05:59:16 -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="kZrIYB/s"; 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 S2388011AbfBRN6H (ORCPT + 99 others); Mon, 18 Feb 2019 08:58:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:38594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388225AbfBRN6D (ORCPT ); Mon, 18 Feb 2019 08:58:03 -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 34CB72077B; Mon, 18 Feb 2019 13:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498282; bh=VfWgv5G+wbGnPVv9rJSsjGJbc3lqBOebaM+ZFQ1GwLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kZrIYB/sd86YIkbyIxmF4lJYt4HKagVksWLHMAFiEDUHv8ZaHxHVnmJpyYlQjkSsJ /3/5+g2MRyXkWhYn9rT5NkwEujreDJfs8euDZBRq4d714yxUbwA+p2LKHJ2KtflkYL tT6linaf6damb1HBo9xaHHVY+ixO2Io4/B3zx24E= 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.9 03/58] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Mon, 18 Feb 2019 14:43:24 +0100 Message-Id: <20190218133508.832709636@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133508.567416115@linuxfoundation.org> References: <20190218133508.567416115@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.9-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 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 */ -- 2.19.1