From nobody Tue Dec 21 23:35:19 2021 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 92FDC1900CB5; Tue, 21 Dec 2021 23:35:20 +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 4JJXr81Q5wz3pL8; Tue, 21 Dec 2021 23:35:20 +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 09F9F12BD5; Tue, 21 Dec 2021 23:35:20 +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 1BLNZJa5049530; Tue, 21 Dec 2021 23:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BLNZJmD049529; Tue, 21 Dec 2021 23:35:19 GMT (envelope-from git) Date: Tue, 21 Dec 2021 23:35:19 GMT Message-Id: <202112212335.1BLNZJmD049529@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: 40bce1ebf3bc - stable/13 - ipfilter: The SNPRINTF macro doesn't exist, remove it 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 40bce1ebf3bc8ddcebc896d3d043166350fef94e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640129720; 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=GXpCd88EXaI17TaPikLeCMXEHrIN3XQ9ARSS86+LGgI=; b=KIS8/QWO2pQOl2N74/NOydtIxCkNXegmV+J1zwK2jeoFh4q09ZdXU85+OhhfVYJutZbmB2 FISQT2h4ybZSzDjcBfSHv4a7yq23v1ATI0NtlV2q+TeSzcjku/9UWKzAXZhaYGGLXJd0uA CuU2blkriskUMxfu1hbW334C9kakNcLIGUrKcNlOrQ3E16vqkbLbmZR521O8p1GyZGpyuc xSNcU1+KARBOyUecBEqLshFsG76W/Iqd33xjehmveX6iDSiSlFjykiJFdt4y74jVkfAIyg /I+NzP3DdXdbkipjvEq0z4qgn3wTiiZAm0MnnsuYEWux/FQ1oqYg1ZLRMvq7Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640129720; a=rsa-sha256; cv=none; b=oEAJ+Fbcw7ybdW6qi2G4gHPU5A/W4Kh+dB4isnnXPYKG4AGZS+KaLym9M/zPIB8r6NAnrH u0ak5vpior00DN/Ti8nZmMpo+AWdvULCqWAHoUk6SkBz+Yj1hduPuZfW+ooPaYEAo2vzny d/j5WLswPsXfnAGslezuDBTrYZObYDvguypj1qVjCyPG1rRdqmklIZl6Uucf8UhtslPzrR Ehcipk+YDw7gCQJdtJa2y9CvzFX0MplDnysqiDLTfg8o6kCZBlEgVfgKMnMeg8GGmOA6LI SNlNQSLShxoKc/eYTYTqeRk/tE+i6UJxPhZx/gY1U8D0Q9nMsQHEK3TaYhdjiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=40bce1ebf3bc8ddcebc896d3d043166350fef94e commit 40bce1ebf3bc8ddcebc896d3d043166350fef94e Author: Cy Schubert AuthorDate: 2021-12-13 21:04:34 +0000 Commit: Cy Schubert CommitDate: 2021-12-21 23:34:40 +0000 ipfilter: The SNPRINTF macro doesn't exist, remove it (cherry picked from commit 8d2a8d243e1e92c6c88a01f56bb36c24ed1a3486) --- 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 4a53ee1727d4..983cb5214606 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);