From patchwork Tue Aug 16 09:47:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Privoznik X-Patchwork-Id: 9283111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5141C60839 for ; Tue, 16 Aug 2016 09:48:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4152C28F18 for ; Tue, 16 Aug 2016 09:48:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35A6F28F1F; Tue, 16 Aug 2016 09:48:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 90C7B28F18 for ; Tue, 16 Aug 2016 09:48:13 +0000 (UTC) Received: from localhost ([::1]:40973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZayi-0004M5-9l for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Aug 2016 05:48:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZayP-0004BH-94 for qemu-devel@nongnu.org; Tue, 16 Aug 2016 05:47:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZayL-0005wo-4B for qemu-devel@nongnu.org; Tue, 16 Aug 2016 05:47:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZayK-0005wd-S6 for qemu-devel@nongnu.org; Tue, 16 Aug 2016 05:47:49 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C02A38535A for ; Tue, 16 Aug 2016 09:47:47 +0000 (UTC) Received: from lisa.redhat.com (vpn-229-97.phx2.redhat.com [10.3.229.97]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7G9lkFa006753 for ; Tue, 16 Aug 2016 05:47:47 -0400 From: Michal Privoznik To: qemu-devel@nongnu.org Date: Tue, 16 Aug 2016 11:47:43 +0200 Message-Id: <23806aac6db3baf7e2cdab4c62d6e3468ce6b4dc.1471340849.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 16 Aug 2016 09:47:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] syscall.c: Fix build with older linux-headers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In c5dff280 we tried to make us understand netlink messages more. So we've added a code that does some translation. However, the code assumed linux-headers to be at least version 4.4 of it because most of the symbols there (if not all of them) were added in just that release. This, however, breaks build on systems with older versions of the package. Signed-off-by: Michal Privoznik --- linux-user/syscall.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 833f853..7edfe4a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1783,30 +1783,58 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr, uint64_t *u64; switch (nlattr->nla_type) { +#ifdef IFLA_BR_FDB_FLUSH /* no data */ case IFLA_BR_FDB_FLUSH: break; +#endif +#ifdef IFLA_BR_GROUP_ADDR /* binary */ case IFLA_BR_GROUP_ADDR: break; +#endif /* uint8_t */ case IFLA_BR_VLAN_FILTERING: +#ifdef IFLA_BR_TOPOLOGY_CHANGE case IFLA_BR_TOPOLOGY_CHANGE: +#endif +#ifdef IFLA_BR_TOPOLOGY_CHANGE_DETECTED case IFLA_BR_TOPOLOGY_CHANGE_DETECTED: +#endif +#ifdef IFLA_BR_MCAST_ROUTER case IFLA_BR_MCAST_ROUTER: +#endif +#ifdef IFLA_BR_MCAST_SNOOPING case IFLA_BR_MCAST_SNOOPING: +#endif +#ifdef IFLA_BR_MCAST_QUERY_USE_IFADDR case IFLA_BR_MCAST_QUERY_USE_IFADDR: +#endif +#ifdef IFLA_BR_MCAST_QUERIER case IFLA_BR_MCAST_QUERIER: +#endif +#ifdef IFLA_BR_NF_CALL_IPTABLES case IFLA_BR_NF_CALL_IPTABLES: +#endif +#ifdef IFLA_BR_NF_CALL_IP6TABLES case IFLA_BR_NF_CALL_IP6TABLES: +#endif +#ifdef IFLA_BR_NF_CALL_ARPTABLES case IFLA_BR_NF_CALL_ARPTABLES: +#endif break; /* uint16_t */ case IFLA_BR_PRIORITY: case IFLA_BR_VLAN_PROTOCOL: +#ifdef IFLA_BR_GROUP_FWD_MASK case IFLA_BR_GROUP_FWD_MASK: +#endif +#ifdef IFLA_BR_ROOT_PORT case IFLA_BR_ROOT_PORT: +#endif +#ifdef IFLA_BR_VLAN_DEFAULT_PVID case IFLA_BR_VLAN_DEFAULT_PVID: +#endif u16 = NLA_DATA(nlattr); *u16 = tswap16(*u16); break; @@ -1816,31 +1844,65 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr, case IFLA_BR_MAX_AGE: case IFLA_BR_AGEING_TIME: case IFLA_BR_STP_STATE: +#ifdef IFLA_BR_ROOT_PATH_COST case IFLA_BR_ROOT_PATH_COST: +#endif +#ifdef IFLA_BR_MCAST_HASH_ELASTICITY case IFLA_BR_MCAST_HASH_ELASTICITY: +#endif +#ifdef IFLA_BR_MCAST_HASH_MAX case IFLA_BR_MCAST_HASH_MAX: +#endif +#ifdef IFLA_BR_MCAST_LAST_MEMBER_CNT case IFLA_BR_MCAST_LAST_MEMBER_CNT: +#endif +#ifdef IFLA_BR_MCAST_STARTUP_QUERY_CNT case IFLA_BR_MCAST_STARTUP_QUERY_CNT: +#endif u32 = NLA_DATA(nlattr); *u32 = tswap32(*u32); break; /* uint64_t */ +#ifdef IFLA_BR_HELLO_TIMER case IFLA_BR_HELLO_TIMER: +#endif +#ifdef IFLA_BR_TCN_TIMER case IFLA_BR_TCN_TIMER: +#endif +#ifdef IFLA_BR_GC_TIMER case IFLA_BR_GC_TIMER: +#endif +#ifdef IFLA_BR_TOPOLOGY_CHANGE_TIMER case IFLA_BR_TOPOLOGY_CHANGE_TIMER: +#endif +#ifdef IFLA_BR_MCAST_LAST_MEMBER_INTVL case IFLA_BR_MCAST_LAST_MEMBER_INTVL: +#endif +#ifdef IFLA_BR_MCAST_MEMBERSHIP_INTVL case IFLA_BR_MCAST_MEMBERSHIP_INTVL: +#endif +#ifdef IFLA_BR_MCAST_QUERIER_INTVL case IFLA_BR_MCAST_QUERIER_INTVL: +#endif +#ifdef IFLA_BR_MCAST_QUERY_INTVL case IFLA_BR_MCAST_QUERY_INTVL: +#endif +#ifdef IFLA_BR_MCAST_QUERY_RESPONSE_INTVL case IFLA_BR_MCAST_QUERY_RESPONSE_INTVL: +#endif +#ifdef IFLA_BR_MCAST_STARTUP_QUERY_INTVL case IFLA_BR_MCAST_STARTUP_QUERY_INTVL: +#endif u64 = NLA_DATA(nlattr); *u64 = tswap64(*u64); break; /* ifla_bridge_id: uin8_t[] */ +#ifdef IFLA_BR_ROOT_ID case IFLA_BR_ROOT_ID: +#endif +#ifdef IFLA_BR_BRIDGE_ID case IFLA_BR_BRIDGE_ID: +#endif break; default: gemu_log("Unknown IFLA_BR type %d\n", nlattr->nla_type); @@ -1868,16 +1930,30 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, case IFLA_BRPORT_PROXYARP: case IFLA_BRPORT_LEARNING_SYNC: case IFLA_BRPORT_PROXYARP_WIFI: +#ifdef IFLA_BRPORT_TOPOLOGY_CHANGE_ACK case IFLA_BRPORT_TOPOLOGY_CHANGE_ACK: +#endif +#ifdef IFLA_BRPORT_CONFIG_PENDING case IFLA_BRPORT_CONFIG_PENDING: +#endif +#ifdef IFLA_BRPORT_MULTICAST_ROUTER case IFLA_BRPORT_MULTICAST_ROUTER: +#endif break; /* uint16_t */ case IFLA_BRPORT_PRIORITY: +#ifdef IFLA_BRPORT_DESIGNATED_PORT case IFLA_BRPORT_DESIGNATED_PORT: +#endif +#ifdef IFLA_BRPORT_DESIGNATED_COST case IFLA_BRPORT_DESIGNATED_COST: +#endif +#ifdef IFLA_BRPORT_ID case IFLA_BRPORT_ID: +#endif +#ifdef IFLA_BRPORT_NO case IFLA_BRPORT_NO: +#endif u16 = NLA_DATA(nlattr); *u16 = tswap16(*u16); break; @@ -1887,15 +1963,25 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, *u32 = tswap32(*u32); break; /* uint64_t */ +#ifdef IFLA_BRPORT_MESSAGE_AGE_TIMER case IFLA_BRPORT_MESSAGE_AGE_TIMER: +#endif +#ifdef IFLA_BRPORT_FORWARD_DELAY_TIMER case IFLA_BRPORT_FORWARD_DELAY_TIMER: +#endif +#ifdef IFLA_BRPORT_HOLD_TIMER case IFLA_BRPORT_HOLD_TIMER: +#endif u64 = NLA_DATA(nlattr); *u64 = tswap64(*u64); break; /* ifla_bridge_id: uint8_t[] */ +#ifdef IFLA_BRPORT_ROOT_ID case IFLA_BRPORT_ROOT_ID: +#endif +#ifdef IFLA_BRPORT_BRIDGE_ID case IFLA_BRPORT_BRIDGE_ID: +#endif break; default: gemu_log("Unknown IFLA_BRPORT type %d\n", nlattr->nla_type);