From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8589A63964 for ; Wed, 25 Nov 2020 12:23:06 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6C5EA18D7B for ; Wed, 25 Nov 2020 12:22:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A736118D5D for ; Wed, 25 Nov 2020 12:22:34 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6627C43B7C for ; Wed, 25 Nov 2020 12:22:34 +0100 (CET) Date: Wed, 25 Nov 2020 12:22:32 +0100 From: Stoiko Ivanov To: Dietmar Maurer Cc: Proxmox VE development discussion , Wolfgang Bumiller Message-ID: <20201125122232.296ccdcf@rosa.proxmox.com> In-Reply-To: <261268061.433.1606302520485@webmail.proxmox.com> References: <20201125103643.26978-1-w.bumiller@proxmox.com> <261268061.433.1606302520485@webmail.proxmox.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.315 Adjusted score from AWL reputation of From: address KAM_ASCII_DIVIDERS 0.8 Spam that uses ascii formatting tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [ripe.net, ietf.org, proxmox.com] Subject: Re: [pve-devel] [PATCH v3 manager] ad #3140: allow interface suffix in dns entries X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:23:06 -0000 On Wed, 25 Nov 2020 12:08:39 +0100 (CET) Dietmar Maurer wrote: > What kind of format is that? RFC2373 does not mention it. Please can > you give me a hint? was curious myself - since I know the format but wasn't sure where it's specified. ripe has a nice explanation: https://labs.ripe.net/Members/philip_homburg/whats-the-deal-with-ipv6-link-local-addresses and refers to https://tools.ietf.org/html/rfc4007 > > > > On 11/25/2020 11:36 AM Wolfgang Bumiller wrote: > > > > > > Signed-off-by: Wolfgang Bumiller > > --- > > changes to v2: > > * use `for of` loop in verify_ip64_address_list > > > > www/manager6/Toolkit.js | 17 ++--------------- > > www/manager6/Utils.js | 27 +++++++++++++++++++++++++++ > > www/manager6/lxc/DNS.js | 2 +- > > 3 files changed, 30 insertions(+), 16 deletions(-) > > > > diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js > > index 55b127c5..0569d649 100644 > > --- a/www/manager6/Toolkit.js > > +++ b/www/manager6/Toolkit.js > > @@ -9,21 +9,8 @@ Ext.apply(Ext.form.field.VTypes, { > > return (/^(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)$/).test(v); > > }, > > QemuStartDateText: gettext('Format') + ': "now" or "2006-06-17T16:01:21" or "2006-06-17"', > > - IP64AddressList: function(v) { > > - var list = v.split(/[\ \,\;]+/); > > - var i; > > - for (i = 0; i < list.length; i++) { > > - if (list[i] == '') { > > - continue; > > - } > > - > > - if (!Proxmox.Utils.IP64_match.test(list[i])) { > > - return false; > > - } > > - } > > - > > - return true; > > - }, > > + IP64AddressList: v => PVE.Utils.verify_ip64_address_list(v, false), > > + IP64AddressWithSuffixList: v => PVE.Utils.verify_ip64_address_list(v, true), > > IP64AddressListText: gettext('Example') + ': 192.168.1.1,192.168.1.2', > > IP64AddressListMask: /[A-Fa-f0-9\,\:\.\;\ ]/ > > }); > > diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js > > index 6d2f7a04..6e6498a2 100644 > > --- a/www/manager6/Utils.js > > +++ b/www/manager6/Utils.js > > @@ -1612,6 +1612,33 @@ Ext.define('PVE.Utils', { utilities: { > > "Host": 4, > > "_default_": 5, // includes custom models > > }, > > + > > + verify_ip64_address_list: function(value, with_suffix) { > > + for (let addr of value.split(/[ ,;]+/)) { > > + if (addr === '') { > > + continue; > > + } > > + > > + if (with_suffix) { > > + let parts = addr.split('%'); > > + addr = parts[0]; > > + > > + if (parts.length > 2) { > > + return false; > > + } > > + > > + if (parts.length > 1 && !addr.startsWith('fe80:')) { > > + return false; > > + } > > + } > > + > > + if (!Proxmox.Utils.IP64_match.test(addr)) { > > + return false; > > + } > > + } > > + > > + return true; > > + }, > > }, > > > > singleton: true, > > diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js > > index a15db5a9..b1e03920 100644 > > --- a/www/manager6/lxc/DNS.js > > +++ b/www/manager6/lxc/DNS.js > > @@ -41,7 +41,7 @@ Ext.define('PVE.lxc.DNSInputPanel', { > > { > > xtype: 'proxmoxtextfield', > > fieldLabel: gettext('DNS servers'), > > - vtype: 'IP64AddressList', > > + vtype: 'IP64AddressWithSuffixList', > > allowBlank: true, > > emptyText: gettext('use host settings'), > > name: 'nameserver', > > -- > > 2.20.1 > > > > > > > > _______________________________________________ > > pve-devel mailing list > > pve-devel@lists.proxmox.com > > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >