From patchwork Mon Sep 21 23:53:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Engelhardt X-Patchwork-Id: 260440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3119C4727C for ; Mon, 21 Sep 2020 23:53:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D545207C4 for ; Mon, 21 Sep 2020 23:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729009AbgIUXxV (ORCPT ); Mon, 21 Sep 2020 19:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgIUXxV (ORCPT ); Mon, 21 Sep 2020 19:53:21 -0400 Received: from a3.inai.de (a3.inai.de [IPv6:2a01:4f8:10b:45d8::f5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37ABAC061755 for ; Mon, 21 Sep 2020 16:53:21 -0700 (PDT) Received: by a3.inai.de (Postfix, from userid 65534) id C7644589A3B0D; Tue, 22 Sep 2020 01:53:19 +0200 (CEST) Received: from a4.inai.de (a4.inai.de [IPv6:2a01:4f8:10b:45d8::f8]) by a3.inai.de (Postfix) with ESMTP id 9E97B589A3B0B; Tue, 22 Sep 2020 01:53:18 +0200 (CEST) From: Jan Engelhardt To: stephen@networkplumber.org Cc: netdev@vger.kernel.org Subject: [PATCH iproute2] ip: do not exit if RTM_GETNSID failed Date: Tue, 22 Sep 2020 01:53:18 +0200 Message-Id: <20200921235318.14001-1-jengelh@inai.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org `ip addr` when run under qemu-user-riscv64, fails. This likely is due to qemu-5.1 not doing translation of RTM_GETNSID calls. 2: host0@if5: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 5a:44:da:1a:c4:0b brd ff:ff:ff:ff:ff:ff request send failed: Operation not supported Treat the situation similar to an absence of procfs. Signed-off-by: Jan Engelhardt Signed-off-by: Jan Engelhardt --- ip/ipnetns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ip/ipnetns.c b/ip/ipnetns.c index 46cc235b..8fab51cd 100644 --- a/ip/ipnetns.c +++ b/ip/ipnetns.c @@ -85,8 +85,9 @@ static int ipnetns_have_nsid(void) addattr32(&req.n, 1024, NETNSA_FD, fd); if (rtnl_send(&rth, &req.n, req.n.nlmsg_len) < 0) { - perror("request send failed"); - exit(1); + have_rtnl_getnsid = 0; + close(fd); + return 0; } rtnl_listen(&rth, ipnetns_accept_msg, NULL); close(fd);