From nobody Tue Nov 19 00:26:51 2024 X-Original-To: dev-commits-src-branches@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 4Xslg02W6Lz5dGfk; Tue, 19 Nov 2024 00:26:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xslfz6yZCz4dhF; Tue, 19 Nov 2024 00:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976012; 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=OStCKpIvff5mmFIPtyDcAOBg3YGRUAiuok9LuUgwODw=; b=UN1+XZyoX96tSAdSOaQ8a/CFyyhieko4Ek+uQWWx6qeqyPh5gBgVvDnglUVcOH1DklUlrQ m1AJfwkEC2t4Ybsx4tEJunP5YeyvrZjKMLjd2Fiflu6Axhe/MivYqfmo1Con8qt/broIQT JNzmgsaFcrHAfC/uj2Fw//zxx/hho+ZoBlID/YieLEGG49N/RQMGd7AAKymCzufE1ltmGy iXXF3Ink9y+X7/ecmp+PdiXNG/GoMrhwOho0JqLGGUqrvC79lkM9uDhIHKVcWhZ0S38BCv zha9pfvzVV3ggKOcw2Gw3Lka/Ffna0bOTnuFktu9WTMW0TkQAIMaDCtir5gAqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976012; 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=OStCKpIvff5mmFIPtyDcAOBg3YGRUAiuok9LuUgwODw=; b=DjxWAjqiFoeCx8ZlYAy54hO8W8rOh9+zQt/X9u9CzxWRiXWMw67vqdYNJaRJ/Suh8oVhfJ tITsh39VJDUYPAPXOncU81ZdwNmBBpyRiz3pC5j3/yPSXc5VNqDLYGfChNXMxV9W3DoFIm cpG5p6gRf3N8FBAsIRuMSWfIPHX2l36EMfqtbSm5QRkEK1p4ILMT2OAtTp6IS5fACk32SS jsIzqCwUMUAOnY+BQt85z7oA/nOKQ7BzzCCgnJJpbj4b0GLbYBZyKekuTzH4nUb277ZD4J ZAIXdexkxF5Q7wQFqV/s4Ro2ZDL8qYnM+g4bw8Dwt5Z1C7uY5SLWKEGnCAMDjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731976012; a=rsa-sha256; cv=none; b=giPdPHIOEqvONsJlsMCRKnqmoFvO4dbAMSYQuQ8DUkOCHx+LZJBoPQ0w9VQGg5L3G/OHTE 9kHiLC68Jx/e9K9rdY+Aa+xvaSZ4kJGC902kHjZ75u51WBQWFaBd25uh+vEPiP5IMC8BR0 gFuw2/u6h3Nm5aVzyZmCKLiRpEx9SJOgOQuvKkOkA+qSNzmQcDNAdMznxlqbjPg2M/vMyq 5Nj/Gj03f1osE/x1ukLytTOj9oRdlIIGpBHOfnrPe6ByYuU74Bs6hTZI4PaeJUXKaJVFj5 H9Ttp6Cj2p4rJqLNX/XinLg2qjTWaV/MQVjY+p3zlF/KfV/Q+mFPsNHfKrDBXg== 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 4Xslfz6YCvz12Vd; Tue, 19 Nov 2024 00:26:51 +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 4AJ0QpEE063939; Tue, 19 Nov 2024 00:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJ0QpKv063936; Tue, 19 Nov 2024 00:26:51 GMT (envelope-from git) Date: Tue, 19 Nov 2024 00:26:51 GMT Message-Id: <202411190026.4AJ0QpKv063936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 43d49c178e12 - stable/14 - ipfilter: Include the IP address in error message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43d49c178e12a93e54742e999cb4233553b11064 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=43d49c178e12a93e54742e999cb4233553b11064 commit 43d49c178e12a93e54742e999cb4233553b11064 Author: Cy Schubert AuthorDate: 2024-11-08 16:30:53 +0000 Commit: Cy Schubert CommitDate: 2024-11-19 00:26:05 +0000 ipfilter: Include the IP address in error message Include the IP address in the message when a hashnode add error occurs. This helps to identify the ippool.conf statement that the error occurred. (cherry picked from commit 9da30a23a5ecae151ae1db045354fab105c69e12) --- sbin/ipf/libipf/load_hashnode.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sbin/ipf/libipf/load_hashnode.c b/sbin/ipf/libipf/load_hashnode.c index bf22edb9be87..12b11687710d 100644 --- a/sbin/ipf/libipf/load_hashnode.c +++ b/sbin/ipf/libipf/load_hashnode.c @@ -53,9 +53,28 @@ load_hashnode(int unit, char *name, iphtent_t *node, int ttl, if (err != 0) if (!(opts & OPT_DONOTHING)) { - char msg[80]; + char msg[255]; + char ipaddr[80], mask_msg[10], mask[8]; - snprintf(msg, sizeof(msg), "%s node from lookup hash table(%s)", what, name); + inet_ntop(ipe.ipe_family, + ipe.ipe_addr.vptr, ipaddr, + sizeof(ipaddr)); +#ifdef USE_INET6 + if (ipe.ipe_family == AF_INET) { +#endif + inet_ntop(ipe.ipe_family, + ipe.ipe_mask.vptr, mask, + sizeof(mask)); + mask_msg[0]='/'; + mask_msg[1]='\0'; + strlcat(mask_msg, mask, sizeof(mask_msg)); +#ifdef USE_INET6 + } else { + mask_msg[0]='\0'; + } +#endif + + snprintf(msg, sizeof(msg), "%s node from lookup hash table(%s) node(%s%s)", what, name, ipaddr, mask_msg); return (ipf_perror_fd(pool_fd(), iocfunc, msg)); } return (0);