From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TccXJMv/; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id DD9E55A061D for ; Sun, 03 May 2026 23:56:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777845384; h=from:from:reply-to:subject:subject: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=yHKB/z4gA9bCCh9+zHfWLdyPMsTUh+k9C4R532tdVhY=; b=TccXJMv/fuKFHIWqMrzlb2RmR6UDETZiiKYLgWXruWhj5Cjv3SaXnzY6+w0F4f7jOknFQm fHtCG2/mRZBbZ5SXRm37u3oKvzutg/GYQ9tVkxqvnEkytSQ4FqETGi4gUgwFnFndlxwiyb DcA1Mc9Z2lX/saNieFj/ZVjfQn9woRw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-IxCUetN6Mc2LQ5R01aceKQ-1; Sun, 03 May 2026 17:56:23 -0400 X-MC-Unique: IxCUetN6Mc2LQ5R01aceKQ-1 X-Mimecast-MFC-AGG-ID: IxCUetN6Mc2LQ5R01aceKQ_1777845382 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-488bd1ee9e7so36160875e9.1 for ; Sun, 03 May 2026 14:56:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777845381; x=1778450181; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yHKB/z4gA9bCCh9+zHfWLdyPMsTUh+k9C4R532tdVhY=; b=oHOkoRTn+3+eBWq/831WT42FOoSxQyibci2VMY14/sMSQBCQlMtkb+lySnCmjiVlUn q/sgi/XqBnZN82pSnPqqHXWY59Q34S6iOCJTyUa16tmfiB0dmmSHiiuoVjDRWRN/8Mzm ltij9XCnv2rk8Pg9RuyypVo0ovtFGu2zgsYVGgBonvwhcVb7enxouJuM5HEAqQrvXaLq OTdAr2+Gvy/Fcj9qj9MKTZMhRVS6TNghB0+pU2P2BOXdH5vn+PkcvUwATpje0X+c2MLw aqpGPQ1ms35u7y6R7WoTXT7Ljcmc7PBlWHxfWV90fhLaPlkTaXoIHo92GL90KbF+l3+S MB2Q== X-Forwarded-Encrypted: i=1; AFNElJ8Hq0xzKdpUoVpqDMIH6i3L5EddTlyYdF3v3vMNJKlM3Hnova2Y3VDOT/qQutGDbaLbEcm2ituSL0Q=@passt.top X-Gm-Message-State: AOJu0YwKO6f+Pm1AYjrQuycKKyt/Wl6owKzow5iN9EwJ+TBWt+3clIZl nt7nqKX0tMQPzzID4Ez9aFTc1hnxKet/r266RX0ZylZonLid+aDTzNyE5PoIfGd3prGjs/DUoh3 HeQdz62pWb1mxwkerYMG7+EoH3E7SKcMmknCjbcWLZf0XqNgFvrt4Ysi5qcP6pQ== X-Gm-Gg: AeBDievFCTVTY805ZKo8dAb/snu7YPPd5bCYmfvtnfxfvpaJRY2U8iTxW27EUi7VGw3 7F6qATJktmSnfuyGa006/TETy0zERwSr2S01cg31Nr5i/T8JDZ0sUs48OPJCZnC21465n10AQum jZh5zHO6E2R8Ofx2jxAflyDR5hbrSwZlKB5K7CUshznR1uT8hwXS68SyUBDj/V+DjnOO1dxCr9m ltfY2ewg76xYxfproED0K7+3AkJ2H+vJumznNS1Kfqw1PEWZCOofBhNo9KKaM4nFvN/nhZ330q/ bT9icBM8gu0uWixqIeofNmjRYdgr2eEIdNcsexl5PE4Cx1MnC7n/lUqYfAmjR6StT9PxAdEVS/8 ZpMmlJ/FmpMT2XN/AbwQSx3XOmbKJxcTqgzwUyVVQaHI= X-Received: by 2002:a05:600c:4445:b0:48a:52ee:5776 with SMTP id 5b1f17b1804b1-48a986380ecmr117880635e9.11.1777845381564; Sun, 03 May 2026 14:56:21 -0700 (PDT) X-Received: by 2002:a05:600c:4445:b0:48a:52ee:5776 with SMTP id 5b1f17b1804b1-48a986380ecmr117880465e9.11.1777845381160; Sun, 03 May 2026 14:56:21 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fef8f39sm64081535e9.32.2026.05.03.14.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2026 14:56:20 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v5 11/18] pesto, conf: Have pesto connect to passt and check versions Message-ID: <20260503235619.5fe63b67@elisabeth> In-Reply-To: References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-12-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sun, 03 May 2026 23:56:19 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JC7Yxomo8rJPQpjTRWUW0UgNgRmfrij6YodROfnU6yg_1777845382 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 7V7WKJLDUVL3B2SLMZ75YIJ5JE3T3USZ X-Message-ID-Hash: 7V7WKJLDUVL3B2SLMZ75YIJ5JE3T3USZ X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jon Maloy , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 29 Apr 2026 15:18:42 +1000 David Gibson wrote: > On Sun, Apr 26, 2026 at 09:45:06AM -0400, Jon Maloy wrote: > > > > > > On 2026-04-21 02:25, David Gibson wrote: > > > Start implementing pesto in earnest. Create a control/configuration > > > socket in passt. Have pesto connect to it and retrieve a server greeting > > > Perform some basic version checking. > > > > [...] > > > > > /** > > > * conf() - Process command-line arguments and set configuration > > > * @c: Execution context > > > @@ -1189,9 +1227,10 @@ void conf(struct ctx *c, int argc, char **argv) > > > {"migrate-exit", no_argument, NULL, 29 }, > > > {"migrate-no-linger", no_argument, NULL, 30 }, > > > {"stats", required_argument, NULL, 31 }, > > > + {"conf-path", required_argument, NULL, 'c' }, > > > { 0 }, > > > }; > > > - const char *optstring = "+dqfel:hs:F:I:p:P:m:a:n:M:g:i:o:D:S:H:461t:u:T:U:"; > > > + const char *optstring = "+dqfel:hs:c:F:I:p:P:m:a:n:M:g:i:o:D:S:H:461t:u:T:U:"; > > > const char *logname = (c->mode == MODE_PASTA) ? "pasta" : "passt"; > > > bool opt_t = false, opt_T = false, opt_u = false, opt_U = false; > > > char userns[PATH_MAX] = { 0 }, netns[PATH_MAX] = { 0 }; > > > @@ -1449,6 +1488,13 @@ void conf(struct ctx *c, int argc, char **argv) > > > c->fd_tap = -1; > > > break; > > > + case 'c': > > > + ret = snprintf(c->control_path, sizeof(c->control_path), > > > + "%s", optarg); > > > + if (ret <= 0 || ret >= (int)sizeof(c->sock_path)) > > > > s/sizeof(c->sock_path)/sizeof(c->config_path)/ > > Oops, yes. > > [snip] > > > @@ -122,5 +128,42 @@ int main(int argc, char **argv) > > > debug("debug_flag=%d, path=\"%s\"", debug_flag, argv[optind]); > > > - die("pesto is not implemented yet"); > > > + if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) > > > + die_perror("Failed to create AF_UNIX socket"); > > > + > > > + ret = snprintf(a.sun_path, sizeof(a.sun_path), "%s", argv[optind]); > > > + if (ret <= 0 || ret >= (int)sizeof(a.sun_path)) > > > + die("Invalid socket path \"%s\"", argv[1]); > > > > s/argv[1]/argv[optind] for consistency. > > And again. > > This is not just for consistency, but for correctness (of the error > message). Depending on the command line, optind may not be equal to > 1. Both fixed in v6. -- Stefano