View | Details | Raw Unified | Return to bug 137317
Collapse All | Expand All

(-)netinet/tcp_input.c (-1 / +1 lines)
Lines 571-577 Link Here
571
		 */
571
		 */
572
		if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) ||
572
		if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) ||
573
		    tcp_log_in_vain == 2) {
573
		    tcp_log_in_vain == 2) {
574
			if ((s = tcp_log_addrs(NULL, th, (void *)ip, ip6)))
574
			if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6)))
575
				log(LOG_INFO, "%s; %s: Connection attempt "
575
				log(LOG_INFO, "%s; %s: Connection attempt "
576
				    "to closed port\n", s, __func__);
576
				    "to closed port\n", s, __func__);
577
		}
577
		}
(-)netinet/tcp_subr.c (-4 / +26 lines)
Lines 268-273 Link Here
268
268
269
static struct inpcb *tcp_notify(struct inpcb *, int);
269
static struct inpcb *tcp_notify(struct inpcb *, int);
270
static void	tcp_isn_tick(void *);
270
static void	tcp_isn_tick(void *);
271
static char *	tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th,
272
		    void *ip4hdr, const void *ip6hdr);
271
273
272
/*
274
/*
273
 * Target size of TCP PCB hash tables. Must be a power of two.
275
 * Target size of TCP PCB hash tables. Must be a power of two.
Lines 2233-2241 Link Here
2233
 * and ip6_hdr pointers have to be passed as void pointers.
2235
 * and ip6_hdr pointers have to be passed as void pointers.
2234
 */
2236
 */
2235
char *
2237
char *
2238
tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
2239
    const void *ip6hdr)
2240
{
2241
2242
	/* Is logging enabled? */
2243
	if (tcp_log_in_vain == 0)
2244
		return (NULL);
2245
2246
	return (tcp_log_addr(inc, th, ip4hdr, ip6hdr));
2247
}
2248
2249
char *
2236
tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
2250
tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
2237
    const void *ip6hdr)
2251
    const void *ip6hdr)
2238
{
2252
{
2253
2254
	/* Is logging enabled? */
2255
	if (tcp_log_debug == 0)
2256
		return (NULL);
2257
2258
	return (tcp_log_addr(inc, th, ip4hdr, ip6hdr));
2259
}
2260
2261
static char *
2262
tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
2263
    const void *ip6hdr)
2264
{
2239
	char *s, *sp;
2265
	char *s, *sp;
2240
	size_t size;
2266
	size_t size;
2241
	struct ip *ip;
2267
	struct ip *ip;
Lines 2258-2267 Link Here
2258
	    2 * INET_ADDRSTRLEN;
2284
	    2 * INET_ADDRSTRLEN;
2259
#endif /* INET6 */
2285
#endif /* INET6 */
2260
2286
2261
	/* Is logging enabled? */
2262
	if (tcp_log_debug == 0 && tcp_log_in_vain == 0)
2263
		return (NULL);
2264
2265
	s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT);
2287
	s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT);
2266
	if (s == NULL)
2288
	if (s == NULL)
2267
		return (NULL);
2289
		return (NULL);
(-)netinet/tcp_var.h (+2 lines)
Lines 611-616 Link Here
611
void	 tcp_fini(void *);
611
void	 tcp_fini(void *);
612
char 	*tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
612
char 	*tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
613
	    const void *);
613
	    const void *);
614
char	*tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *,
615
	    const void *);
614
int	 tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
616
int	 tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
615
void	 tcp_reass_init(void);
617
void	 tcp_reass_init(void);
616
#ifdef VIMAGE
618
#ifdef VIMAGE

Return to bug 137317