From patchwork Thu Feb 14 13:18:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 158382 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1359187jaa; Thu, 14 Feb 2019 05:18:11 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia7aRYQHMbgLAvglikXgLM4XfKLLw/SMMimXFnkfe4T+hWflYX/mSGZLjFD0wIQZnTLzslD X-Received: by 2002:a17:902:9a04:: with SMTP id v4mr4204986plp.34.1550150291629; Thu, 14 Feb 2019 05:18:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550150291; cv=none; d=google.com; s=arc-20160816; b=Crk37gvBwaPHz172f1zxmOQxmFb2QiBdghxNb7oN1xC5ccJ2kE8C91KqeNBHm+XrMY h0jpqGq85tLe/0OpUjxPggz/snXRJKr4j2IZTwds6d5iq3pH7viiVBChC99oRhK7aPgQ dvq2VT29EEYiZbpIf6kQX6zM/iqAKvQ8+pjBSsHDdQRtw9m1kM9+jcDM4haiMW75l6Yx oulylSMnyLizb0sDOu7lcdAC19xHEf4QTUNP3NmPSp623+da4r4tqhGoCxWyhwZbyeaG 1FqTmm5A1Tb8sasJitivr8OwK5UU12ScSYCgQJWhyJEkGLQ2gmge01aOhDCLTTvi04Zf XuOw== 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=Bk3aEpdEqKwI7DXly5e7OJjiRwFbuAMhxe0npVIkNtE=; b=H/vQjXtADZm4iIDSP8iUko8mSsHzc1P7lv6U+N9U+4ekjnn+1WqJFUqgWKIbVJPW4K WneCfbAUGOLRGPG/LYyM9ko0obRUXgAiFatLtauj6AZOSqq7um86YYPNIoX7ouDDTpuu Mv8TXVvql2cLoIsFeXVPaKlMUGMBR0IvnEHSzu+CvoJ376v28WU78hfc91hv7681w4MC SdqKheLZ0za3ISO6ddJWafF7rRLu+iGpYcLa+dkQ/xCq0kroy/30/w9k/tbTn6e8pyO2 T6+gGCnGm5geJWwhW3I1V9jAcsCcOMtarpLqZkvFHL6HqkQ0vvCS7v+tsuuOXeOqEbNl C5Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KqH/ZlgU"; 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 f124si2588160pfa.1.2019.02.14.05.18.11; Thu, 14 Feb 2019 05:18:11 -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="KqH/ZlgU"; 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 S2403991AbfBNNSL (ORCPT + 15 others); Thu, 14 Feb 2019 08:18:11 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46829 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729596AbfBNNSK (ORCPT ); Thu, 14 Feb 2019 08:18:10 -0500 Received: by mail-lf1-f68.google.com with SMTP id f5so4480060lfc.13 for ; Thu, 14 Feb 2019 05:18:09 -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=Bk3aEpdEqKwI7DXly5e7OJjiRwFbuAMhxe0npVIkNtE=; b=KqH/ZlgUmdyJD5O+unAPXN2iVSrxcvQGZbPgFrRfPfyfVxH6vDyP/nfXaS2IWHDqVZ BblGzs4lQY9ytNgC4drpTST1XPmTJmAKbdOKOEc3LZPerWR3Otcpd3ktLC/Rx68xZ88a XGZVcCkWxJCxq5ORPH3bINJqbv4hLd6vrGrZY5ZGw7ht61WXlTShc2VNl28+6mgtPyIP vZQWu0QQb3m+uPqj/+wdC990uMWYMF9s0eDk+psBJaef6GdlD9vGRV88P19QW3Il2tPo pJWS0HqjDY0bXaRLj+mIhIzs7U+C/J9G+r3byS1QIZtfekPDZemiMvXghMtuFWJLojYg suhg== 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=Bk3aEpdEqKwI7DXly5e7OJjiRwFbuAMhxe0npVIkNtE=; b=XpF0JbIdIbvMRpF8Q4HlrcXs7zuYuD3f7oUL8wd/xsqQ7sNCpwve48mSACiK5cbQqr NoAMITq/Un7V1iK7wEJsORud4dWq27xUdGqs2bvLCe7DohUSBEjr1B95AKzNjRy3FeaF /l1+3o9qpdd4OIn+Gq6lhz+/oxbdYCGo8+3IH4nDmrUyAlHIblCGLU5clO39/Sagf8P2 w21Y/pHJ95hgLPC7mVgzKBV0dIxY9IbxMCzKA5MjU34j9obb3zH1CBx9zviLSyZhYohp tFBPKMO9s3E8oL8jed8OnuPrvK9rXC+qg4+1zDDQZuyQ0JKHGKbnB1Wgvdjm0Ebd/X35 wzjg== X-Gm-Message-State: AHQUAuZ93gNtepf2OaHohzWyLUSckly+D7LVLOmcyd58CJwM5PkxrzE6 PReOb0BSOORGbiV1ryiyO6maxeAmaU4= X-Received: by 2002:a19:4851:: with SMTP id v78mr2329908lfa.98.1550150288649; Thu, 14 Feb 2019 05:18:08 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v4-v6sm430253ljv.56.2019.02.14.05.18.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 05:18:07 -0800 (PST) From: Linus Walleij To: Greg Kroah-Hartman , stable@vger.kernel.org, openwrt-devel@lists.openwrt.org Cc: "David S . Miller" , Hauke Mehrtens , Linus Walleij Subject: [PATCH v2] uapi/if_ether.h: prevent redefinition of struct ethhdr Date: Thu, 14 Feb 2019 14:18:00 +0100 Message-Id: <20190214131800.8760-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 Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Add SoB line - 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 */