FreeBSD Bugzilla – Attachment 12876 Details for
Bug 24683
obscure natd(8) error message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
natd.newpatch
natd.newpatch (text/plain; charset=us-ascii), 1.87 KB, created by
k.brunner
on 2001-01-28 12:01:48 UTC
(
hide
)
Description:
natd.newpatch
Filename:
MIME Type:
Creator:
k.brunner
Created:
2001-01-28 12:01:48 UTC
Size:
1.87 KB
patch
obsolete
>Index: natd/natd.c >=================================================================== >RCS file: /home/ncvs/src/sbin/natd/natd.c,v >retrieving revision 1.25.2.3 >diff -u -r1.25.2.3 natd.c >--- natd/natd.c 2000/07/11 20:00:57 1.25.2.3 >+++ natd/natd.c 2001/01/28 11:57:13 >@@ -586,7 +586,7 @@ > static void FlushPacketBuffer (int fd) > { > int wrote; >- char msgBuf[80]; >+ char msgBuf[160]; > /* > * Put packet back for processing. > */ >@@ -616,10 +616,12 @@ > } > else { > >- sprintf (msgBuf, "failed to write packet back"); >+ snprintf (msgBuf, sizeof(msgBuf), >+ "failed to write packet back (%s)", >+ FormatPacket((struct ip*)packetBuf); > Warn (msgBuf); > } >- } >+ } > > packetSock = -1; > } >@@ -680,7 +682,8 @@ > switch (ip->ip_p) { > case IPPROTO_TCP: > tcphdr = (struct tcphdr*) ((char*) ip + (ip->ip_hl << 2)); >- sprintf (buf, "[TCP] %s:%d -> %s:%d", >+ snprintf (buf, sizeof(buf), >+ "[TCP] %s:%d -> %s:%d", > src, > ntohs (tcphdr->th_sport), > dst, >@@ -689,7 +692,8 @@ > > case IPPROTO_UDP: > udphdr = (struct udphdr*) ((char*) ip + (ip->ip_hl << 2)); >- sprintf (buf, "[UDP] %s:%d -> %s:%d", >+ snprintf (buf, sizeof(buf), >+ "[UDP] %s:%d -> %s:%d", > src, > ntohs (udphdr->uh_sport), > dst, >@@ -698,7 +702,8 @@ > > case IPPROTO_ICMP: > icmphdr = (struct icmp*) ((char*) ip + (ip->ip_hl << 2)); >- sprintf (buf, "[ICMP] %s -> %s %u(%u)", >+ snprintf (buf, sizeof(buf), >+ "[ICMP] %s -> %s %u(%u)", > src, > dst, > icmphdr->icmp_type, >@@ -706,7 +711,8 @@ > break; > > default: >- sprintf (buf, "[%d] %s -> %s ", ip->ip_p, src, dst); >+ snprintf (buf, sizeof(buf), "[%d] %s -> %s ", >+ ip->ip_p, src, dst); > break; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 24683
:
12875
| 12876