diff options
author | ache <ache@FreeBSD.org> | 1996-04-27 18:19:12 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-04-27 18:19:12 +0000 |
commit | 8a5de28c053b2c80cc2ba69536bf073ffc6c07d0 (patch) | |
tree | 0933c6e88bae06cd24ded3a802e0f22cf4064bf5 /sys/netinet | |
parent | 9c10d8e8d1ef9d87ac73dc6a79e60d0e25079d5a (diff) | |
download | FreeBSD-src-8a5de28c053b2c80cc2ba69536bf073ffc6c07d0.zip FreeBSD-src-8a5de28c053b2c80cc2ba69536bf073ffc6c07d0.tar.gz |
inet_ntoa buffer was evaluated twice in log_in_vain, fix it.
Thanx to: jdp
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 10 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 10 |
3 files changed, 21 insertions, 9 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9132b33..17cfd32 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.42 1996/04/09 07:01:51 pst Exp $ + * $Id: tcp_input.c,v 1.43 1996/04/26 18:32:57 wollman Exp $ */ #ifndef TUBA_INCLUDE @@ -377,11 +377,15 @@ findpcb: * but should either do a listen or a connect soon. */ if (inp == NULL) { - if (log_in_vain && tiflags & TH_SYN) + if (log_in_vain && tiflags & TH_SYN) { + char buf[4*sizeof "123"]; + + strcpy(buf, inet_ntoa(ti->ti_dst)); log(LOG_INFO, "Connection attempt to TCP %s:%d" " from %s:%d\n", - inet_ntoa(ti->ti_dst), ntohs(ti->ti_dport), + buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src), ntohs(ti->ti_sport)); + } goto dropwithreset; } tp = intotcpcb(inp); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 9132b33..17cfd32 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $Id: tcp_input.c,v 1.42 1996/04/09 07:01:51 pst Exp $ + * $Id: tcp_input.c,v 1.43 1996/04/26 18:32:57 wollman Exp $ */ #ifndef TUBA_INCLUDE @@ -377,11 +377,15 @@ findpcb: * but should either do a listen or a connect soon. */ if (inp == NULL) { - if (log_in_vain && tiflags & TH_SYN) + if (log_in_vain && tiflags & TH_SYN) { + char buf[4*sizeof "123"]; + + strcpy(buf, inet_ntoa(ti->ti_dst)); log(LOG_INFO, "Connection attempt to TCP %s:%d" " from %s:%d\n", - inet_ntoa(ti->ti_dst), ntohs(ti->ti_dport), + buf, ntohs(ti->ti_dport), inet_ntoa(ti->ti_src), ntohs(ti->ti_sport)); + } goto dropwithreset; } tp = intotcpcb(inp); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 220b976..dd8fd6e 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $Id: udp_usrreq.c,v 1.21 1996/04/04 10:46:44 phk Exp $ + * $Id: udp_usrreq.c,v 1.22 1996/04/09 07:01:53 pst Exp $ */ #include <sys/param.h> @@ -279,11 +279,15 @@ udp_input(m, iphlen) uh->uh_dport, INPLOOKUP_WILDCARD); } if (inp == NULL) { - if (log_in_vain) + if (log_in_vain) { + char buf[4*sizeof "123"]; + + strcpy(buf, inet_ntoa(ip->ip_dst)); log(LOG_INFO, "Connection attempt to UDP %s:%d" " from %s:%d\n", - inet_ntoa(ip->ip_dst), ntohs(uh->uh_dport), + buf, ntohs(uh->uh_dport), inet_ntoa(ip->ip_src), ntohs(uh->uh_sport)); + } udpstat.udps_noport++; if (m->m_flags & (M_BCAST | M_MCAST)) { udpstat.udps_noportbcast++; |