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=Z5PeeiiS; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 2CAC85A0657 for ; Sun, 26 Apr 2026 15:45:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777211110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Sj+TPHqTSu4ZS0hnttn/8e+Vs+D+RrJdXeXpIt4c+4=; b=Z5PeeiiSSaPfmAMHV0BF30qYZKjE3LqgiyluhxnUirgRs10f0vPNg3RzFsNFDc6vYR1kgz P9fvxYl0V60iKYCTZV+9sf/hsfsdXqEmcUpYSye7vCrURbgh3pYFdQtas/lMT6GEMF5UeG KJ0Yy+qXoio1PK0rtFs8nlIygf60Z6Y= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-209-_3p59yoaPey5k-Pwe4Ofmw-1; Sun, 26 Apr 2026 09:45:08 -0400 X-MC-Unique: _3p59yoaPey5k-Pwe4Ofmw-1 X-Mimecast-MFC-AGG-ID: _3p59yoaPey5k-Pwe4Ofmw_1777211108 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8d5d03ae893so1628190685a.3 for ; Sun, 26 Apr 2026 06:45:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777211108; x=1777815908; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/Sj+TPHqTSu4ZS0hnttn/8e+Vs+D+RrJdXeXpIt4c+4=; b=iZs6WprKtwipCLXzwQyJwlUTF48ZE2u/frmgYkGki3kOyC38pfTgPRvY2kZB5xN7Oo SCJ4a9ws3JCpeEzjdaFXK3wO4n+Qq7Mpp+dObF4RJ8OhPWqBC02+WJIl98L1VSgIxDJT q7etiJ9HH4B5XM+jVCw+YmfeI27KW43CHSO/+BIEotaoCywea+CYovrH5XU0phuZyFa6 mXmKEaXD3kzV48AJmIMwFXrkrYlpF/s+qYVL8pvvEKeoNUBrQJaCv04ikaE4sJYW9CIX d3dxPfdPPfGOxWGONeAYe/6ytHDQkpfdeqo6SFDFSSwaaw8R2q+aD0oafMKc7lx+fYEK 18hQ== X-Forwarded-Encrypted: i=1; AFNElJ88ritulYCw6kI80qivs44RkCGsp8G37QuuZjZauNiZwrBuUY9kXhvM65e/M6p3lhnxSBIFMtxMYKA=@passt.top X-Gm-Message-State: AOJu0YyMz7nEJ0UBbdEBzYdpGLqMDOoGSnqJxP9ixCnUrHMmbjuIV4jM a5KPKrMA6c9wD+AJpD+HopTvynEvK25/2icvxNB+WRz1EfddfuKUXkW1wO5GKKw8puR8HWcY8Yt nT95XxG4ihqSx69571SKfk2m4a4a8FqmzKWQ0c/XHD8twxo9+sdfIJQ== X-Gm-Gg: AeBDietmRBgshm11vl+KuSwRisueeopa52w+IdODv+PBb7kcLHoaBjBb3GusxkDpxVy vullzU+9JQWjMkisEdMgfX3VzmH5MpYxR48w3eFpJde8u199KGl0BADfHLOJz2xnyiwuE0Mr0zC vk/uMYOeeO+0tIlecJURGio5VisTSKrmChIyNMKAVQVjiqyMI3iNved/4pXSOKWMaNjZNfYJDs4 8hj90xhYJliN4iZpR+ZXCaxkPzkj2Sjh25btank0cbex4NnR4eOLRlmAaA1uVjZdpqPSG0/cvoQ 9oaqR/+qis86AZdVCE+LrWcnJBGmCb6+6+OIkvXB1mlOjTkmhnmNfx8H8HAwCY9HIahKYIYzfUJ 7dlIUEDg/PamBEGjrvvIeJ5eeFHKb74VnHB7ZmrqzaJhgkAFERuVak5bGhoh0Y4B+USUtOkvPIH dixiVL/yTE7qTJT726pVhCtOI= X-Received: by 2002:a05:620a:3189:b0:8ef:12de:1346 with SMTP id af79cd13be357-8ef12de17f4mr3144671285a.52.1777211107829; Sun, 26 Apr 2026 06:45:07 -0700 (PDT) X-Received: by 2002:a05:620a:3189:b0:8ef:12de:1346 with SMTP id af79cd13be357-8ef12de17f4mr3144663285a.52.1777211107336; Sun, 26 Apr 2026 06:45:07 -0700 (PDT) Received: from [192.168.2.15] (lnsm4-toronto63-142-116-28-118.internet.virginmobile.ca. [142.116.28.118]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8eb428ca90bsm2123804185a.4.2026.04.26.06.45.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Apr 2026 06:45:06 -0700 (PDT) Message-ID: Date: Sun, 26 Apr 2026 09:45:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 11/18] pesto, conf: Have pesto connect to passt and check versions To: David Gibson , Stefano Brivio , passt-dev@passt.top References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-12-david@gibson.dropbear.id.au> From: Jon Maloy In-Reply-To: <20260421062516.2601204-12-david@gibson.dropbear.id.au> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: HrpcBA-Ek3ystJNNmbuZQ5ctDEr0LJeYloY4mLurzBk_1777211108 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Hits: emergency X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved Message-ID-Hash: UV66BWJLJXHYOUQL2J56OT5XTIESFB7G X-Message-ID-Hash: UV66BWJLJXHYOUQL2J56OT5XTIESFB7G X-Mailman-Approved-At: Mon, 27 Apr 2026 09:47:04 +0200 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 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)/ > + die("Invalid configuration path: %s", optarg); > + c->fd_control_listen = c->fd_control = -1; > + break; > case 'F': > errno = 0; > fd_tap_opt = strtol(optarg, NULL, 0); [...] > int main(int argc, char **argv) > @@ -76,9 +79,12 @@ int main(int argc, char **argv) > {"version", no_argument, NULL, 1 }, > { 0 }, > }; > + struct sockaddr_un a = { AF_UNIX, "" }; > const char *optstring = "dh"; > + struct pesto_hello hello; > struct sock_fprog prog; > - int optname; > + int optname, ret, s; > + uint32_t s_version; > > prctl(PR_SET_DUMPABLE, 0); > > @@ -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. ///jon