--- netinet/tcp_output.c 2008-04-23 01:27:11.000000000 +0200 +++ /u/perforce/tcp_reass/netinet/tcp_output.c 2008-05-08 00:37:13.000000000 +0200 @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD: src/sys/netinet/tcp_ #include #include #include +#include #include @@ -131,7 +132,7 @@ tcp_output(struct tcpcb *tp) struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; - struct tcphdr *th; + struct tcphdr *th = NULL; u_char opt[TCP_MAXOLEN]; unsigned ipoptlen, optlen, hdrlen; #ifdef IPSEC @@ -142,6 +143,8 @@ tcp_output(struct tcpcb *tp) struct sackhole *p; int tso = 0; struct tcpopt to; + char *s; + int ipout = 0; #if 0 int maxburst = TCP_MAXBURST; #endif #ifdef TCP_SIGNATURE @@ -1132,6 +1134,8 @@ timer: if (path_mtu_discovery) ip->ip_off |= IP_DF; + ipout = 1; + error = ip_output(m, tp->t_inpcb->inp_options, NULL, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, tp->t_inpcb); @@ -1165,6 +1169,13 @@ timer: } out: SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ + + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: error %i while sending (ip_output %i)\n", + s, __func__, error, ipout); + free(s, M_TCPLOG); + } + switch (error) { case EPERM: tp->t_softerror = error;