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=I3I6euKt; 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 78F4E5A061D for ; Sun, 03 May 2026 23:56:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777845401; 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=4eiMZIizF6i+WWP4Ro1GVu3sQqn2Ty9NFtsurQTQLIs=; b=I3I6euKtlZBy1nMJMdKmCWs3Yz4Ms1vzybDxr4UOtp/8NXOqkQTMQ6kFwKzzSNt6AyzSAk nVrUl5+G5I7c2pjE/tCvgYU+J5FpUaAoK9nDZdQ5Kb8ObshcE2cyj5ktfDoV+h9Xzrjxnt PJ8klyTrlwxh/f+ihxO9mIg/Jl2yph4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-Vam7e9r5NUKZ5ZoMAaWk-A-1; Sun, 03 May 2026 17:56:40 -0400 X-MC-Unique: Vam7e9r5NUKZ5ZoMAaWk-A-1 X-Mimecast-MFC-AGG-ID: Vam7e9r5NUKZ5ZoMAaWk-A_1777845399 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4836abfc742so27311525e9.0 for ; Sun, 03 May 2026 14:56:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777845398; x=1778450198; 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=4eiMZIizF6i+WWP4Ro1GVu3sQqn2Ty9NFtsurQTQLIs=; b=B0KNA96Kyt9znPpqEelh24dpOXxsYz/UhJELFi3DcFUPqGHe4rIi6A+qhSpihL3VNZ /M4ZZWcipH40qeEEteYYcc38Mj0IkQoM8Pnsz6pHBdCXS9ddwkW6vmvkLXMNsUNxuK+d zeyHnKCER5Dop+Zd0n/IfqBdJs3litAsnPjpdUuuQqGe7YZhXAgj2YOaVJPEY7qmC+Hw U7w0wEzSkzELJtECnr7oMAiscgSLfg9Kgs3Xstimybrlgzh3bx/rqR+sQw9e52Qp9QGR +E5T1TGYO7/mgB/jLCjSOjRLGyFW3ak6ReGTuyMZvP7+tpLA7leV82CLUYlOQFGU11qI OwcQ== X-Forwarded-Encrypted: i=1; AFNElJ/3yyMGv5CjeANJtmUo1obZ2OzMmAr2MJHs/z0KiM1YaBNPiiQEOHWgE2xPB+4yuv3Sm+Jz6d15dq4=@passt.top X-Gm-Message-State: AOJu0Yz//0pJV6eEdgZCRgXgXJ3a+e4EzDBtJAzKAII+ZbuEPXKK+Qll 1r1mzH9Ykcdg2XiSL8OtLTrX5d28ryzuEvypkWSh84mTlAbTZHHZkldw4l387fxSMP6ZWkfakIv MG6pkUQf5bTwSEOhQoNYdFnhiFU9QzXzUkEoo8HrUIs7bkEmcYmAIpOUNqs2gKg== X-Gm-Gg: AeBDieua1Xx9q7UD8P+BZx3OJ1GrOAS1XDvSCzp9aRWB37dTWu4T4/aX2q91lBpMlLp GXBKI3Zf3HfUfZ3Ma7RZhMnyH3JR/Ef0xeAAkGtkNqMKG59NYLZpm0a7wn3Zfa2S3xHCtsWc7iW qEmvI9J3Ifo0VuTlFYaySBOn4e5zp6fDwuJvVG7g3qI8ndop4YzjcQ4lWM1+cKabNBHVYukzMHa ZInLDRX6w7SJIMFOLQ03et+3g/PbEiUVPOV8+zH4ONPghQ3yrARGBW+LhBLGey9Ui4RE977ClwU HKLiQZm18YeVZKje7WSCFS+XTzYgp8zGgOFdpLInTaEvNyAHYM5FBaruepzsEJmyja5Ny9tqTLj +1nRsR9DBIYjTOaLwWns3gFjqbvwUZxLq3TXroUCJhjFbUzHN8Qhc9OOB/C6I X-Received: by 2002:a05:600c:1e8b:b0:488:a797:f0ac with SMTP id 5b1f17b1804b1-48a98675ffcmr112333165e9.28.1777845398154; Sun, 03 May 2026 14:56:38 -0700 (PDT) X-Received: by 2002:a05:600c:1e8b:b0:488:a797:f0ac with SMTP id 5b1f17b1804b1-48a98675ffcmr112332885e9.28.1777845397566; Sun, 03 May 2026 14:56:37 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8ebb2f32sm222687105e9.13.2026.05.03.14.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2026 14:56:32 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v5 15/18] pesto: Read current ruleset from passt/pasta and optionally display it Message-ID: <20260503235631.76f5810b@elisabeth> In-Reply-To: References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-16-david@gibson.dropbear.id.au> <20260425113558.2dbc419e@elisabeth> 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:32 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lJIBF7NV3BClOnTKRyf6UjlNWCLJG64iclUnHUcDNn0_1777845399 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: DQCEI6E6QIAGNGZHMANGYHIETBRBL2TO X-Message-ID-Hash: DQCEI6E6QIAGNGZHMANGYHIETBRBL2TO 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:19:22 +1000 David Gibson wrote: > On Sat, Apr 25, 2026 at 11:35:59AM +0200, Stefano Brivio wrote: > > On Fri, 24 Apr 2026 18:37:58 -0400 > > Jon Maloy wrote: > > > > > On 2026-04-21 02:25, David Gibson wrote: > > > > Implement serialisation of our current forwarding rules in conf.c, > > > > deserialising it to display in the pesto client. Doing this requires > > > > adding ip.c, inany.c, bitmap.c, lineread.c and fwd_rule.c to the pesto > > > > build. With previous preparations that now requires only a trivial change > > > [...] > > > > > > > + > > > > + > > > > +/** > > > > + * fwd_rule_read() - Read serialised rule from an fd > > > > + * @fd: fd to serialise to > > > > + * @rule: Buffer to store rule into > > > > + * > > > > + * Return: 0 on success, -1 on error (with errno set) > > > > + */ > > > > +int fwd_rule_read(int fd, struct fwd_rule *rule) > > > > +{ > > > > + if (read_all_buf(fd, rule, sizeof(*rule))) > > > > + return -1; > > > > + > > > > + /* Byteswap for host */ > > > > + rule->first = ntohs(rule->first); > > > > + rule->last = ntohs(rule->last); > > > > + rule->to = htons(rule->to); > > > Or ntohs() ? > > > > Thanks, nice catch, I'll fix this (I'm adopting this series and trying > > to complete it while David is off). > > Oops, yes, good catch, thanks. Fixed in v6. -- Stefano