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=IvX7X34j; 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 71BC85A0625 for ; Wed, 17 Dec 2025 23:51:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766011902; 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=EGel6F5Dk4pyoUwgo6EUZgLnXbr1X9GRaQDQC4k6uxQ=; b=IvX7X34jDaEPtB4/Lt2KUqyd5LbInfNTMAScBmr3ME9qXk2mbJ6hYWMChcZgP6NdCGx09/ 2CJgRecopkRVeAd/jM91+8szKZSNAFl+74Xu8v7Zv9NZQhj111VJqlR6ud0YHRHIz3dFey QZICJFxn90lPh4Y45CZhBd++7z+kKFI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-Daq690VcM22D0j-Y9b31Cg-1; Wed, 17 Dec 2025 17:51:40 -0500 X-MC-Unique: Daq690VcM22D0j-Y9b31Cg-1 X-Mimecast-MFC-AGG-ID: Daq690VcM22D0j-Y9b31Cg_1766011899 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-430fafdf2f3so1666404f8f.1 for ; Wed, 17 Dec 2025 14:51:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766011899; x=1766616699; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EGel6F5Dk4pyoUwgo6EUZgLnXbr1X9GRaQDQC4k6uxQ=; b=lF1HFUMNYEhXzP81ACdpyh1Zd/5DnmGxMLawNeJ3pTPhkY9w+30NNvPs6D2z8GMY6w 93CVUpocW2VBKWHoM/MuEDYadqDiFED0HH+HaEyTu4v75rnqc5tMzYcQCl7IfFfZ3k+S 6hOtjFX5hXqqnGvkNNVdzek734vrKjuq4RxyuX29YE+KjPWP+6KxR/f6vJI5HZrJmunR prw6MwkRO1Qf74UZeCrwpzLzKs47EQoxgqQBmj5BMVi0RQzSffZPt5m7yYGwVgQsQYp+ QNfM1ZjSDOSS3G6mQDucK1/ZBtoc4/4aQy6iDYazg/L3rPBEAq8Nr11S8SW+w2tTslIn Rt8g== X-Forwarded-Encrypted: i=1; AJvYcCVGSf0QCpuzWmNY3mXOMLq2/0TnLASlHYVNX+FCBswddbVFC3jlwatESr6C/SS2oZLAy62zhpv0TDU=@passt.top X-Gm-Message-State: AOJu0YziJfgvjiATT2PufPXgIwGT4Yx35OllweBWKcz/3GzRbNJ9u/t6 pQX5RfGiUy6V6Idcf3yNdLxIdQT8z8OXiKf8Aggs42WVB+aBPvGNKS98RYbL/BrkrbVvKTo2bdE 7+eBMzXP77f1Bz9ygZbcItmT1rbiCv59GH2RxpfifMDIAjMLVWx5uHw== X-Gm-Gg: AY/fxX69LEYK68/l4dejbxAhpTlFT73/TrWWZcaoUlvivnc58RfwwOPWDoaYItF62/F Nfyysm9rIv+MByIM3KkVxTBG6WleFkHLdoTZFpSm1tuAYsm4Ujq0x5VsD91sNI2KnsWJvKflO7W +oBpB+nSBQV8C/UAGeZxSY6fzi8Nd8N3neacZ4864IT3E58dnuGQP9CCbpECtAXFJCDz3cPkO+z MnnKIdvwRAo/8ubl5szobb/JnjblYekkPX0DZGKWJN0RulnrwJBRaOTyFudc4exfUBxMDHEnt6q YgNyMHeWWaIFnw8SiyBBGbfma/MzG4Tx7Zv6k80JLwdTNKHE5uyFyxAOe4333rrnocMqgLBkZzz b0lrzpaMRzk80ZF4at/pn X-Received: by 2002:a05:6000:2001:b0:430:f742:fbb4 with SMTP id ffacd0b85a97d-430f742fd2bmr14684914f8f.43.1766011899340; Wed, 17 Dec 2025 14:51:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBhFW3FhPEaVnA3Gd7Wlc/G+GCW6l7CdJ31fry1ukhlJGaNOErB6p0fBjyl2y/mEBC5Nd58g== X-Received: by 2002:a05:6000:2001:b0:430:f742:fbb4 with SMTP id ffacd0b85a97d-430f742fd2bmr14684900f8f.43.1766011898838; Wed, 17 Dec 2025 14:51:38 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324498fbd2sm1486175f8f.27.2025.12.17.14.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 14:51:37 -0800 (PST) Date: Wed, 17 Dec 2025 23:51:36 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v2] conf: Support CIDR notation for -a/--address option Message-ID: <20251217235136.6902af17@elisabeth> In-Reply-To: <20251217213142.358407-1-jmaloy@redhat.com> References: <20251217213142.358407-1-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: gtx5e-0w40AG3sja5_jUA6TbndzpZBcJ4j4SsqhHi0E_1766011899 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: QWA26MIYME3AQJZPYI4A4PH2SZAFG5OD X-Message-ID-Hash: QWA26MIYME3AQJZPYI4A4PH2SZAFG5OD 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: dgibson@redhat.com, david@gibson.dropbear.id.au, 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, 17 Dec 2025 16:31:42 -0500 Jon Maloy wrote: > Extend the -a/--address option to accept addresses in CIDR notation > (e.g., 192.168.1.1/24 or 2001:db8::1/64) as an alternative to using > separate -a and -n options. > > Add conf_addr_prefix() helper function that: > - Parses address strings with optional /prefix suffix That's not the prefix, that's the prefix length. > - Validates prefix length based on address family (0-32 for IPv4, > 0-128 for IPv6) > - Returns address family and fills address/prefix output parameters > > For IPv4, the prefix is stored in ip4.prefix_len when provided. > Multiple CIDR addresses use last-wins semantics for the prefix, > consistent with how addresses are handled currently. However, > mixing -n and CIDR notation results in an error to catch likely > user mistakes. > > Also fix a bug in conf_ip4_prefix() that was incorrectly using the > global 'optarg' instead of its 'arg' parameter. > > Signed-off-by: Jon Maloy > > --- > v2: Fixed incorrect error printout, as noted by Laurent Vivier. > We now keep the old semantics, i.e., allowing multiple -a > options for each protocol. This semantics looks wrong, > but will anyway be fixed in my upcoming series. > > Signed-off-by: Jon Maloy > --- > conf.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 84 insertions(+), 15 deletions(-) man page update is missing altogether. Not a full review, but it will be easier to review once the new behaviour is documented. -- Stefano