From nobody Thu Jul 11 19:49:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKlfQ6rsqz5RJmM; Thu, 11 Jul 2024 19:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WKlfQ6KlSz4G11; Thu, 11 Jul 2024 19:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720727342; 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; bh=hwsnRwJ+LuEJYn/7sGVyKKjUeKw+gDUsK8dpCsN+QYw=; b=sAeG7sqGp8ESUXM4BgPIYFtF0Cn6Yt7zhwt/yY5oPQOVU6z76/EzSZ30aA1s4rFpOdQg/q t4mCv8thgmmiFQ0kfIGSzBoIYT83Md3zI19ZVR4YFU+Tgyp3ozjGh4/JYiUbYE1h+XSbAB Mmto8lJs9otwPUCPVunqvnK0tjsGDlUks9ZHjuCB7wwE/XZawsoPmlHd9VO6n3feuwz5lq 8W7oIFBjj8JWIFIGyZ3UGib4AiUmkkIW5E/3XcGKkS6qcY01MyxelLi++WHFjvgaAvqqx0 LSvxuzUKVozgmV7QYnJIwBEUsNr+dOukRGudbBKZRWHYd3UOKyICIfaJderjQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720727342; a=rsa-sha256; cv=none; b=qztQAQzeSwShcnK/3IXbJVgiPPMmZRRm6KrJ3gzhR2hFmeeUbkyuWrzkNhzcjLR+4rRe0E 0DTvVxw6Ih/Om/Ae/uhc9XqktpjHilTQZeWO/cr3hap+bh4oXwMsokUEfhKnxD3fTmJ2Y3 KsezEecdkENJov8QCzUuoII/Xa79nDWAsZlw6mHu1WkBUvSN0HnfeTQipbnuSHxmqZKWbH ujSrNge4epr6shW39C36ydlb3TDVE9NzO/bK/+vVkUVFFF6dRUAA7gkdqL7GIQ2YcOKjfG 2ia2aUVIrgt7dwgHuBQ3t+nYtHj9RBhULtGo4WHSv6A1FtF55CwbbITP5D6arw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720727342; 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; bh=hwsnRwJ+LuEJYn/7sGVyKKjUeKw+gDUsK8dpCsN+QYw=; b=jWheWy/Vzv5og6+PnKa5R6DLWnB1qx/em9VNgxpYHYOijdJLAuDoOoRdgDfJEyzpqhzl+R VvCYR4JcaIPpGZuYOsuySIRFRvVLadDrXTu2Xdd9QQjfdcDnILrs/rfJ9HFPO+HDczNKQb PxhXsopn50Y8K674lafwd37kf52CY/K2eeMAmla1XJewboU0P9/TOd/2Ddpqf4OGlk/oZj W86LZf6p3eM9AKzlIcRuN7oIWFAfXSkuCdJhpDctQ8BZxH8+OzLvvlIzMkOzujzVQPrufS 2Gm9tivRQLcQR5HerZu1LJrM2GFWUxZN0+F6CTkvUKRRdP9n1SqvMjC2Uzekhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WKlfQ5xrHz1CN1; Thu, 11 Jul 2024 19:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46BJn2T9089838; Thu, 11 Jul 2024 19:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46BJn2D4089835; Thu, 11 Jul 2024 19:49:02 GMT (envelope-from git) Date: Thu, 11 Jul 2024 19:49:02 GMT Message-Id: <202407111949.46BJn2D4089835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 8cd71a0e01d6 - main - libfetch: parse IPv4address in IPv6address properly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cd71a0e01d60cc4eb0cdef3c62556a516976b77 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=8cd71a0e01d60cc4eb0cdef3c62556a516976b77 commit 8cd71a0e01d60cc4eb0cdef3c62556a516976b77 Author: Ka Ho Ng AuthorDate: 2024-07-11 19:48:28 +0000 Commit: Ka Ho Ng CommitDate: 2024-07-11 19:48:28 +0000 libfetch: parse IPv4address in IPv6address properly This fix parsing problems of IPv6 addresses which contains IPv4 addresses. One example is ::192.168.0.1. Documents are in below: https://datatracker.ietf.org/doc/html/rfc2373#page-22 Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D45896 --- lib/libfetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index df97bf486f9b..12cbd0fb746f 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -399,7 +399,7 @@ fetchParseURL(const char *URL) /* hostname */ if (*p == '[') { - q = p + 1 + strspn(p + 1, ":0123456789ABCDEFabcdef"); + q = p + 1 + strspn(p + 1, ":0123456789ABCDEFabcdef."); if (*q++ != ']') goto ouch; } else {