ipfilter: The SNPRINTF macro doesn't exist, remove it
MFC after: 1 week
This commit is contained in:
parent
0da2c91e64
commit
8d2a8d243e
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user