From nobody Tue May 7 05:22:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1605626381; cv=none; d=zohomail.com; s=zohoarc; b=FB6BV63vnX0WH1osw9FIBj9keTRpKhVgpMfO8iSeuBoxvjcHqqwSg3Ha3kNq2qwiEPdn5HuyzL1CTLquTBYonpOXshUWdfI2e9mzEEwFbvPRo0f7hzF3JdI9YB12KLLHDStlzUpSclUPnHAUpzfQT5bNdO32O96vWFaIPeGJgRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605626381; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gcu7LH01TQmg/1oeIC8n//xjkFKSxAmiLiSTqW3ReyU=; b=WR3YtAb/rglhSKcv1zqITJGOBYjlOWqHqRXTQkaCXxg6Ubk6nAnvSxBDnGHiJNhH8YP7MYbo2pF5nEP2jJK6xQQw8NfXhfOuLOvf+bnof9k2Qo3pXRzOJV0ZtaB1+3loKelRW61PKE2jMs9b9NgRla/HojqnyRKr5Rx1x05XByY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605626381772799.6471209909432; Tue, 17 Nov 2020 07:19:41 -0800 (PST) Received: from localhost ([::1]:59514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf2lg-0004ZM-MB for importer@patchew.org; Tue, 17 Nov 2020 10:19:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf2j8-0001zP-Qe for qemu-devel@nongnu.org; Tue, 17 Nov 2020 10:17:02 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:43287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf2j3-0007ZT-3m for qemu-devel@nongnu.org; Tue, 17 Nov 2020 10:17:02 -0500 Received: from localhost.localdomain ([82.252.130.226]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MODeL-1ku6bn2KPB-00ObUa; Tue, 17 Nov 2020 16:16:54 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/2] linux-user, netlink: fix message translation with ip command Date: Tue, 17 Nov 2020 16:16:49 +0100 Message-Id: <20201117151650.867836-2-laurent@vivier.eu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117151650.867836-1-laurent@vivier.eu> References: <20201117151650.867836-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Wm4qTgjFtLerns3oucEypn99wNOAhakzrHK6/UlahNhi8d/Hfy6 UkrN49r3ZnqVzNOVIQJAsmeQk0IS80HQZhrmQbaq9jnPSuhaVWC7V3dteKl9ti1NE7Bm8X+ NoPi92ptf7Zg0AbVr0eNEvvloucJZ4nfVB2I3xCqOVpgFT+0NmPIE2YLPG9O+wAoHFkPAJ/ Ds/2p5ZAsBwUXgccZ0J9w== X-UI-Out-Filterresults: notjunk:1;V03:K0:A+ovUduV6Tg=:biuRMXa+b8CM+E8+W8VQQP lfqDF5lP+SfMicU9apDtLXRwIJ9XUpuy2E29G8M307Il8b8p9ijRkWojHhe/8dxxHLrm4mnzr NTM1mANtHBfoHynrCIugSj4546LRN530DqTNugBRSGnZ6Y5mkQwbX1TPvEg5dUIDfq+r8zuh0 mVJUlEmf3FIOPptV9L0GstlOjoRyfGJOdg9r7kkYp/GXug1U/H6Gogtpz2ek/WMjxsQl9mfCe Ym6BzWFJwrbGyeEabOUrZ/pSZdzEBjASqtE+6tqCxTkxbvo9AF0ya4M1ppKnEbqYu7sCO94DV VKUglLG0vI11lqT6aHoVdTIhnDE2Z6pslimjvWwnliEKRu3YXh7kfESUPX/EDMFqDfYoyWnjw mJJK+xPguVUNkvmiIUcYtlaX1nC1NPk00mB6kbbl2KNUlVaaW9NCNbbFCN2O8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/17 10:16:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" With iproute2-5.8.0, the route, link and addr show commands fail: root@sid:~# ip addr show RTNETLINK answers: Unknown error 352321537 Dump terminated root@sid:~# ip link show RTNETLINK answers: Unknown error 352321537 Dump terminated root@sid:~# ip route show RTNETLINK answers: Unknown error 352321537 Dump terminated This patch correctly decodes the GETROUTE and GETLINK commands and adds the RTA_TABLE message. Signed-off-by: Laurent Vivier Message-Id: <20201116163622.791442-1-laurent@vivier.eu> --- linux-user/fd-trans.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 1486c81aaa27..7551c883304a 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -1160,6 +1160,7 @@ static abi_long target_to_host_data_route_rtattr(stru= ct rtattr *rtattr) break; /* u32 */ case QEMU_RTA_PRIORITY: + case QEMU_RTA_TABLE: case QEMU_RTA_OIF: u32 =3D RTA_DATA(rtattr); *u32 =3D tswap32(*u32); @@ -1200,11 +1201,10 @@ static abi_long target_to_host_data_route(struct nl= msghdr *nlh) struct rtmsg *rtm; =20 switch (nlh->nlmsg_type) { - case RTM_GETLINK: - break; case RTM_NEWLINK: case RTM_DELLINK: case RTM_SETLINK: + case RTM_GETLINK: if (nlh->nlmsg_len >=3D NLMSG_LENGTH(sizeof(*ifi))) { ifi =3D NLMSG_DATA(nlh); ifi->ifi_type =3D tswap16(ifi->ifi_type); @@ -1225,10 +1225,9 @@ static abi_long target_to_host_data_route(struct nlm= sghdr *nlh) NLMSG_LENGTH(sizeof(*ifa))); } break; - case RTM_GETROUTE: - break; case RTM_NEWROUTE: case RTM_DELROUTE: + case RTM_GETROUTE: if (nlh->nlmsg_len >=3D NLMSG_LENGTH(sizeof(*rtm))) { rtm =3D NLMSG_DATA(nlh); rtm->rtm_flags =3D tswap32(rtm->rtm_flags); --=20 2.28.0 From nobody Tue May 7 05:22:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1605626302; cv=none; d=zohomail.com; s=zohoarc; b=oDLwRUvoqvmozNT4iBBTN8Y2OazGn9o2gwDFFFjf5DXqbwPOXGeWMcr3rsDwk3YDT+Yr+lzhaCyZSq0RhM0sYXMPxNhKptAxsrFNXsX9hduuzNufbtYf4ZiUrwW2wQIaHxanqwzb3Bx545q7lb5hOB/Frc/1bfrZmqYspCk7wRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605626302; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PB3MvNz/o3zoraEWwywEpXdcYjhBEqUO4ExvHxHBLx0=; b=dfFX1HDYeUMDIkdiwIuYs1OlN2JeecqC+1nprv3qaalPfrojJ6zKz9gJkPaaNk3gz1y81GMSL+xGgXwt5yAJu63mb/FeXk6xlYmDK1sGkgMeKt32vljL0kUbtG0uJExMIy3L5KsH4gO0JoMPGCJMXU+xnwGp+RTuwf3ifUXgaRQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605626302863976.8607155818884; Tue, 17 Nov 2020 07:18:22 -0800 (PST) Received: from localhost ([::1]:55558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf2kP-0002wJ-QM for importer@patchew.org; Tue, 17 Nov 2020 10:18:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf2jB-000211-QP for qemu-devel@nongnu.org; Tue, 17 Nov 2020 10:17:05 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf2j3-0007ZW-Aq for qemu-devel@nongnu.org; Tue, 17 Nov 2020 10:17:05 -0500 Received: from localhost.localdomain ([82.252.130.226]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MvsyF-1kNWCn3zGB-00sxxS; Tue, 17 Nov 2020 16:16:55 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/2] linux-user, netlink: add IFLA_BRPORT_MRP_RING_OPEN, IFLA_BRPORT_MRP_IN_OPEN Date: Tue, 17 Nov 2020 16:16:50 +0100 Message-Id: <20201117151650.867836-3-laurent@vivier.eu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117151650.867836-1-laurent@vivier.eu> References: <20201117151650.867836-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:RG3h/1GIPmujHFsVODM+JcG424mz7FrVXkLR0BkhHuGtPQi7Y1n fsoIMq1FqD1OhyCW+tfdd7uSa0u3KpL0o8GlzYO/swmd5lrTwHTWgK2mTtaj5UBq9PdYPx2 IfySBLZyFtXPhnEkj6Na9QEhqrbcS0UJ4JNca2KK8l9ffshsb1XaXS8o/6o7CuRkYoJV1JT AttLCjz+CjAg1Ji2Z6sQw== X-UI-Out-Filterresults: notjunk:1;V03:K0:DDJ+cZWVjcY=:stKsdyJtSQ80hB9tOG68PP R1G/M0viCU9BgUVjbDXwybInc+HpgX3OQLLvXkyOFIMhUF8ST5VnWR4DszwZDe4kPmltIc30X H9lJXxRKJDHRfsfHzzAx3XIsXt29EDWDFzYUlW2J5ZcINKQCrzNzQoPulK5TKRb9xWcrlWYQJ 1IAlVHVG2GHEnRzeuVrC/uhLWX7T9LVQUnUNJffjBvxr3kkPN+NFsl6qpsNOqekAFNl0XKzAy aE5Vr87rzcL1/1vegqIJ3tG/hGrkZT6hAKmYyxSKXRofBunloQnceeYUnBxlc5jeIkKeCGiEm vJ6VoOXOZY33meaIRN/dT8U9l6TlggwFHOEky8T/pzw11jM4k4nx29NBFmmT1l+zNWnR6JISN mwf5/TPr4Co1DEoKnP6fNUTS1rsObIKYaXX51ioYGE9sYx2CVLqO6dvrmxACeIji+hyxtVHIK YNaOByNP6A== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/17 10:16:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Fix "-d unimp" trace results: Unknown QEMU_IFLA_BRPORT type 35 Unknown QEMU_IFLA_BRPORT type 36 Also process IFLA_EXT_MASK to fix: Unknown target QEMU_IFLA type: 29 Signed-off-by: Laurent Vivier Message-Id: <20201117111905.843925-1-laurent@vivier.eu> --- linux-user/fd-trans.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 7551c883304a..23adaca83639 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -175,6 +175,8 @@ enum { QEMU_IFLA_BRPORT_NEIGH_SUPPRESS, QEMU_IFLA_BRPORT_ISOLATED, QEMU_IFLA_BRPORT_BACKUP_PORT, + QEMU_IFLA_BRPORT_MRP_RING_OPEN, + QEMU_IFLA_BRPORT_MRP_IN_OPEN, QEMU___IFLA_BRPORT_MAX }; =20 @@ -552,6 +554,8 @@ static abi_long host_to_target_slave_data_bridge_nlattr= (struct nlattr *nlattr, case QEMU_IFLA_BRPORT_BCAST_FLOOD: case QEMU_IFLA_BRPORT_NEIGH_SUPPRESS: case QEMU_IFLA_BRPORT_ISOLATED: + case QEMU_IFLA_BRPORT_MRP_RING_OPEN: + case QEMU_IFLA_BRPORT_MRP_IN_OPEN: break; /* uint16_t */ case QEMU_IFLA_BRPORT_PRIORITY: @@ -1125,7 +1129,14 @@ static abi_long target_to_host_for_each_rtattr(struc= t rtattr *rtattr, =20 static abi_long target_to_host_data_link_rtattr(struct rtattr *rtattr) { + uint32_t *u32; + switch (rtattr->rta_type) { + /* uint32_t */ + case QEMU_IFLA_EXT_MASK: + u32 =3D RTA_DATA(rtattr); + *u32 =3D tswap32(*u32); + break; default: qemu_log_mask(LOG_UNIMP, "Unknown target QEMU_IFLA type: %d\n", rtattr->rta_type); --=20 2.28.0