From nobody Tue Dec 14 14:20:12 2021 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 5138618EB6D2; Tue, 14 Dec 2021 14:20:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JD0rr6mZvz4mMs; Tue, 14 Dec 2021 14:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C4B4E1A2F; Tue, 14 Dec 2021 14:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BEEKCtp098670; Tue, 14 Dec 2021 14:20:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BEEKCX1098657; Tue, 14 Dec 2021 14:20:12 GMT (envelope-from git) Date: Tue, 14 Dec 2021 14:20:12 GMT Message-Id: <202112141420.1BEEKCX1098657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 8d2a8d243e1e - main - ipfilter: The SNPRINTF macro doesn't exist, remove it 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8d2a8d243e1e92c6c88a01f56bb36c24ed1a3486 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639491613; 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=W8OYUwKdvzMeuX5eAONZiexkRqx9OArdcLoYrLNgtGc=; b=Odirh/DbadlIC3uiJpJG6Trv/U1Zs5rMfQMES7LXiEyl0YDDSSHdUNw3dT+xTyKEh3VaL2 2eXdKJKO/JvJFFAIY3imyx2t7itKWi9VmF/R5YzYM8rcEvJx5xkthmQ22NJko8fAKeYSUe aEgvdkBmzgftKqNUWtmSnvE1XEzmVzgdvVhDVqs8hZ9H3BO8YEU/0E104G1nTMQg8Yaluz NdGjVaCY8RIZmD+3mNBBw7dnC+8HR6hnuSQFCkjWELaerHrToYIX1oLEK0uuyYv7BZliUm yT8vshVvffcL71nl/NCVk1LAODBvA6NOqcgLha3HfbyHfs8dUdVMtGjG1IoC+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639491613; a=rsa-sha256; cv=none; b=sUEXLv5aaipb8E+u/dmD6BIQfrufwsOVe6KTq3im5j6rZZ50axTJ4gGCRjU/JXm79HeuL8 6Dk8MZG+jgH3/EOJp2aPltRGGuGJntsgvLqIiGZ0wjEd1oh6nZHXLxJOhOxynYvEfu9xlN g6DCSROAGFTbfIhe68jO8+dHy44a8/7nMVcKKPJnzw2ENOHFuFFoCyito0R4Bl1SbXvQMY SgEaKl1+M0e8nx/r848hvFMGMEZh9mK0rwO2t0OgAwno0ovni1Z6vkti9iZe5usWbRPeRW XwEncwet0/cCyIrmJE8pzTYTFRvw2QxFQnK0Y+8N1WgpMXNry0hhotKa0YgBSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8d2a8d243e1e92c6c88a01f56bb36c24ed1a3486 commit 8d2a8d243e1e92c6c88a01f56bb36c24ed1a3486 Author: Cy Schubert AuthorDate: 2021-12-13 21:04:34 +0000 Commit: Cy Schubert CommitDate: 2021-12-14 14:19:20 +0000 ipfilter: The SNPRINTF macro doesn't exist, remove it MFC after: 1 week --- sys/contrib/ipfilter/netinet/fil.c | 8 ------ sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 45 ------------------------------ sys/contrib/ipfilter/netinet/ip_htable.c | 4 --- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 4 --- sys/contrib/ipfilter/netinet/ip_lookup.c | 4 --- sys/contrib/ipfilter/netinet/ip_pool.c | 8 ------ sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c | 12 -------- 7 files changed, 85 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 89f50c261474..e90dc50ed0d6 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -5611,11 +5611,7 @@ ipf_grpmapinit(softc, fr) char name[FR_GROUPLEN]; iphtable_t *iph; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(name, sizeof(name), "%d", fr->fr_arg); -#else (void) sprintf(name, "%d", fr->fr_arg); -#endif iph = ipf_lookup_find_htable(softc, IPL_LOGIPF, name); if (iph == NULL) { IPFERROR(38); @@ -6172,11 +6168,7 @@ ipf_getifname(ifp, buffer) unit = ifp->if_unit; space = LIFNAMSIZ - (s - buffer); if ((space > 0) && (unit >= 0)) { -# if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(temp, sizeof(temp), "%d", unit); -# else (void) sprintf(temp, "%d", unit); -# endif (void) strncpy(s, temp, space); } # endif diff --git a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c index a495292687d9..9783d2dd39a7 100644 --- a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c @@ -403,14 +403,8 @@ ipf_p_ftp_port(softf, fin, ip, nat, ftp, dlen) a4 = a1 & 0xff; a1 >>= 24; olen = s - f->ftps_rptr; - /* DO NOT change this to snprintf! */ -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(newbuf, sizeof(newbuf), "%s %u,%u,%u,%u,%u,%u\r\n", - "PORT", a1, a2, a3, a4, a5, a6); -#else (void) sprintf(newbuf, "%s %u,%u,%u,%u,%u,%u\r\n", "PORT", a1, a2, a3, a4, a5, a6); -#endif nlen = strlen(newbuf); inc = nlen - olen; @@ -834,15 +828,9 @@ ipf_p_ftp_pasv(softf, fin, ip, nat, ftp, dlen) a4 = a1 & 0xff; a1 >>= 24; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(newbuf, sizeof(newbuf), "%s %s%u,%u,%u,%u,%u,%u%s\r\n", - "227 Entering Passive Mode", brackets[0], a1, a2, a3, a4, - a5, a6, brackets[1]); -#else (void) sprintf(newbuf, "%s %s%u,%u,%u,%u,%u,%u%s\r\n", "227 Entering Passive Mode", brackets[0], a1, a2, a3, a4, a5, a6, brackets[1]); -#endif return ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (a5 << 8 | a6), newbuf, s); } @@ -1849,14 +1837,9 @@ ipf_p_ftp_eprt4(softf, fin, ip, nat, ftp, dlen) * sense to preserve whatever character is being used by the systems * involved in the communication. */ -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(newbuf, sizeof(newbuf), "%s %c1%c%u.%u.%u.%u%c%u%c\r\n", - "EPRT", delim, delim, a1, a2, a3, a4, delim, port, delim); -#else (void) sprintf(newbuf, "%s %c1%c%u.%u.%u.%u%c%u%c\r\n", "EPRT", delim, delim, a1, a2, a3, a4, delim, port, delim); -#endif nlen = strlen(newbuf); inc = nlen - olen; @@ -1955,13 +1938,8 @@ ipf_p_ftp_epsv(softf, fin, ip, nat, ftp, dlen) } s += 2; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(newbuf, sizeof(newbuf), "%s (|||%u|)\r\n", - "229 Entering Extended Passive Mode", ap); -#else (void) sprintf(newbuf, "%s (|||%u|)\r\n", "229 Entering Extended Passive Mode", ap); -#endif return ipf_p_ftp_pasvreply(softf, fin, ip, nat, ftp, (u_int)ap, newbuf, s); @@ -2106,28 +2084,6 @@ ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen) */ s = newbuf; left = sizeof(newbuf); -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(newbuf, left, "EPRT %c2%c", delim, delim); - left -= strlen(s) + 1; - s += strlen(s); - a = ntohl(a6->i6[0]); - SNPRINTF(s, left, "%x:%x:", a >> 16, a & 0xffff); - left -= strlen(s); - s += strlen(s); - a = ntohl(a6->i6[1]); - SNPRINTF(s, left, "%x:%x:", a >> 16, a & 0xffff); - left -= strlen(s); - s += strlen(s); - a = ntohl(a6->i6[2]); - SNPRINTF(s, left, "%x:%x:", a >> 16, a & 0xffff); - left -= strlen(s); - s += strlen(s); - a = ntohl(a6->i6[3]); - SNPRINTF(s, left, "%x:%x", a >> 16, a & 0xffff); - left -= strlen(s); - s += strlen(s); - SNPRINTF(s, left, "|%d|\r\n", port); -#else (void) sprintf(s, "EPRT %c2%c", delim, delim); s += strlen(s); a = ntohl(a6->i6[0]); @@ -2146,7 +2102,6 @@ ipf_p_ftp_eprt6(softf, fin, ip, nat, ftp, dlen) left -= strlen(s); s += strlen(s); sprintf(s, "|%d|\r\n", port); -#endif nlen = strlen(newbuf); inc = nlen - olen; if ((inc + fin->fin_plen) > 65535) { diff --git a/sys/contrib/ipfilter/netinet/ip_htable.c b/sys/contrib/ipfilter/netinet/ip_htable.c index bd1a7136086f..db65c8652be4 100644 --- a/sys/contrib/ipfilter/netinet/ip_htable.c +++ b/sys/contrib/ipfilter/netinet/ip_htable.c @@ -325,11 +325,7 @@ ipf_htable_create(softc, arg, op) i = IPHASH_ANON; do { i++; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(name, sizeof(name), "%u", i); -#else (void)sprintf(name, "%u", i); -#endif for (oiph = softh->ipf_htables[unit + 1]; oiph != NULL; oiph = oiph->iph_next) if (strncmp(oiph->iph_name, name, diff --git a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c index 4446b2100645..a233d24b9a87 100644 --- a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c @@ -310,11 +310,7 @@ ipf_p_irc_send(fin, nat) i++; (void) strncpy(newbuf, ctcpbuf, i); /* DO NOT change these! */ -#if defined(SNPRINTF) && defined(KERNEL) - SNPRINTF(newbuf, sizeof(newbuf) - i, "%u %u\001\r\n", a1, a5); -#else (void) sprintf(newbuf, "%u %u\001\r\n", a1, a5); -#endif nlen = strlen(newbuf); inc = nlen - olen; diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.c b/sys/contrib/ipfilter/netinet/ip_lookup.c index 66dec84944a1..931d91f4e5f2 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.c +++ b/sys/contrib/ipfilter/netinet/ip_lookup.c @@ -845,11 +845,7 @@ ipf_lookup_res_num(softc, unit, type, number, funcptr) { char name[FR_GROUPLEN]; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(name, sizeof(name), "%u", number); -#else (void) sprintf(name, "%u", number); -#endif return ipf_lookup_res_name(softc, unit, type, name, funcptr); } diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index fdd83ebd977f..a890fdf455fc 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -982,21 +982,13 @@ ipf_pool_create(softc, softp, op) h->ipo_flags |= IPOOL_ANON; poolnum = LOOKUP_ANON; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(name, sizeof(name), "%x", poolnum); -#else (void)sprintf(name, "%x", poolnum); -#endif for (p = softp->ipf_pool_list[unit + 1]; p != NULL; ) { if (strncmp(name, p->ipo_name, sizeof(p->ipo_name)) == 0) { poolnum++; -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(name, sizeof(name), "%x", poolnum); -#else (void)sprintf(name, "%x", poolnum); -#endif p = softp->ipf_pool_list[unit + 1]; } else p = p->ipo_next; diff --git a/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c b/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c index 4c7996e59300..88e300b0625f 100644 --- a/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c @@ -789,11 +789,7 @@ ipf_p_rpcb_modreq(fin, nat, rm, m, off) /* Form new string. */ bzero(uaddr, sizeof(uaddr)); /* Just in case we need padding. */ -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(uaddr, sizeof(uaddr), -#else (void) sprintf(uaddr, -#endif "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff, i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff); len = strlen(uaddr); @@ -1326,11 +1322,7 @@ ipf_p_rpcb_modv3(fin, nat, rm, m, off) /* Form new string. */ bzero(uaddr, sizeof(uaddr)); /* Just in case we need padding. */ -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(uaddr, sizeof(uaddr), -#else (void) sprintf(uaddr, -#endif "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff, i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff); len = strlen(uaddr); @@ -1406,11 +1398,7 @@ ipf_p_rpcb_modv4(fin, nat, rm, m, off) /* Form new string. */ bzero(uaddr, sizeof(uaddr)); /* Just in case we need padding. */ -#if defined(SNPRINTF) && defined(_KERNEL) - SNPRINTF(uaddr, sizeof(uaddr), -#else (void) sprintf(uaddr, -#endif "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff, i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff);