Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7961070rwr; Wed, 10 May 2023 15:34:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oVEZldYLkzgzRJ9JF2ZLXNVgkmx2OLf8mIERaWBCTx+i7xfmFMrva5m5V07osXLb6ExQV X-Received: by 2002:a05:6a20:42a5:b0:101:3046:8db3 with SMTP id o37-20020a056a2042a500b0010130468db3mr8729228pzj.22.1683758081518; Wed, 10 May 2023 15:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683758081; cv=none; d=google.com; s=arc-20160816; b=lwk3+K77mIoetu+uueaevTuqdBt6OkTD/nOtBP/wOgCjY4Oj520dpKNwo7lvc8Yvgv wy6BqlvWq8wnrcA6kgnlJmZ+EARJj2ljAEUFpq6UKBOZx+bES3N7gXKTxj6eQeM3w0Mr RNfMuylwTAJdX/2JSfouas06k3j/uJL4CaGL80n+WXG26YWJuRNi+hPEZQhb0L4jvEMG 6IV08vTxKtjdp0WO9VbAhxj4x8YlFtLxfy8xYNSD/SuOT4KeWUp1Zyv9tnPQQWRfNydA J9ggaHHSqSi+8kZPkm60PuGzO0xV6hNH4IDhW5PIXTHQdJqG0b8I+e0tDLR6Kk/pi1GL wReA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:dkim-signature; bh=oySt+/k4oQpJvoHZlSaYx4amjfvrxaxHGtzf74/bvS0=; b=KuJkNCNiIDx+T5XnFO+NvAzxQXZXSdDIZ27lAOwqZciuZqaUuhx71DeXn67pNb60lN xJFddgM5s2kiq/lL4tmG+tVDZQ75v04BWWM+OESBJAP1VQjXLnMXw02j3SkykvasijuD S+5jqJ456exH856qNzXWYfLlKHfOuWQ6yb+QsObfYPae8qsRccsM2Hnu54Cu3Lgxqjto 2sPC3vW0bkDP1O00wzUXlxlO29wr6T02ObJAP2vEIaralxooBhzYoWyNfIySuTfIzcwp B15XIq3LMYq9IXYgNYkjcayQaxYJM7P63UXrdbxBhPNuvFG6xuUsMd3rD4rDV8HTaRE6 vQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LrnbRRj2; dkim=neutral (no key) header.i=@suse.de header.b=ZUELha1t; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020a633f0c000000b00528a60ab393si4841823pga.314.2023.05.10.15.34.27; Wed, 10 May 2023 15:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LrnbRRj2; dkim=neutral (no key) header.i=@suse.de header.b=ZUELha1t; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbjEJW2I (ORCPT + 99 others); Wed, 10 May 2023 18:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236125AbjEJW2F (ORCPT ); Wed, 10 May 2023 18:28:05 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 491A42D56 for ; Wed, 10 May 2023 15:28:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E226D21994; Wed, 10 May 2023 22:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683757682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oySt+/k4oQpJvoHZlSaYx4amjfvrxaxHGtzf74/bvS0=; b=LrnbRRj2pseZDVbZOqZzrQWrhrPYxo4DqqmZkFZynY5CA69KP9nidOpT2Jh5Pr2Z9hIrcd MvUh+tfs/q/g1SoIJhOCho2aQQukvMygzsRqjDuXQo0bc6Mb/xB82t36Ht8nOYFH3VGPyb Jvoidbwx0gGO2WvTp4pv2/P941wnGTI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683757682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oySt+/k4oQpJvoHZlSaYx4amjfvrxaxHGtzf74/bvS0=; b=ZUELha1tIlx9V3+FpHetAZ0NpyzYDHvx8i6vKWM0Tv0fCLJ7atoGSTDCTMujfPt6sy6I6Y ws4tIHV9lBlZFHDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7FFE513519; Wed, 10 May 2023 22:28:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id u/wkDnAaXGR8DAAAMHmgww (envelope-from ); Wed, 10 May 2023 22:28:00 +0000 Subject: [PATCH 2/2] rpcinfo: try connecting using abstract address. From: NeilBrown To: Jeff Layton , Trond Myklebust Cc: linux-nfs@vger.kernel.org, Petr Vorel , Nikita Yushchenko , Steve Dickson Date: Thu, 11 May 2023 08:27:36 +1000 Message-ID: <168375765675.30997.4851750258993172980.stgit@noble.brown> In-Reply-To: <168375751051.30997.11634044913854205425.stgit@noble.brown> References: <168375751051.30997.11634044913854205425.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org rpcinfo doesn't use library calls to set up the address for rpcbind. So to get to it try the new abstract address, we need to explicitly teach it how. Signed-off-by: NeilBrown --- src/rpcinfo.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/rpcinfo.c b/src/rpcinfo.c index 0e14f78ad2de..4464cbc0941b 100644 --- a/src/rpcinfo.c +++ b/src/rpcinfo.c @@ -311,6 +311,13 @@ main (int argc, char **argv) return (0); } +/* Evaluate to actual length of the `sockaddr_un' structure, whether + * abstract or not. + */ +#include +#define SUN_LEN_A(ptr) (offsetof(struct sockaddr_un, sun_path) \ + + 1 + strlen((ptr)->sun_path + 1)) + static CLIENT * local_rpcb (rpcprog_t prog, rpcvers_t vers) { @@ -334,6 +341,7 @@ local_rpcb (rpcprog_t prog, rpcvers_t vers) endnetconfig(localhandle); return clnt; #else + CLIENT *clnt; struct netbuf nbuf; struct sockaddr_un sun; int sock; @@ -344,12 +352,26 @@ local_rpcb (rpcprog_t prog, rpcvers_t vers) return NULL; sun.sun_family = AF_LOCAL; + +#ifdef _PATH_RPCBINDSOCK_ABSTRACT + memcpy(sun.sun_path, _PATH_RPCBINDSOCK_ABSTRACT, + sizeof(_PATH_RPCBINDSOCK_ABSTRACT)); + nbuf.len = SUN_LEN_A (&sun); + nbuf.maxlen = sizeof (struct sockaddr_un); + nbuf.buf = &sun; + + clnt = clnt_vc_create (sock, &nbuf, prog, vers, 0, 0); + if (clnt) + return clnt; +#endif + strcpy (sun.sun_path, _PATH_RPCBINDSOCK); nbuf.len = SUN_LEN (&sun); nbuf.maxlen = sizeof (struct sockaddr_un); nbuf.buf = &sun; - return clnt_vc_create (sock, &nbuf, prog, vers, 0, 0); + clnt = clnt_vc_create (sock, &nbuf, prog, vers, 0, 0); + return clnt; #endif }