Make Slirp statistics gathering and output conditional to LOG_ENABLED
[qemu] / slirp / tcp_subr.c
index 3814ec1..a20a088 100644 (file)
@@ -255,9 +255,9 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err)
        if (TCPS_HAVERCVDSYN(tp->t_state)) {
                tp->t_state = TCPS_CLOSED;
                (void) tcp_output(tp);
-               tcpstat.tcps_drops++;
+               STAT(tcpstat.tcps_drops++);
        } else
-               tcpstat.tcps_conndrops++;
+               STAT(tcpstat.tcps_conndrops++);
 /*     if (errno == ETIMEDOUT && tp->t_softerror)
  *             errno = tp->t_softerror;
  */
@@ -305,7 +305,7 @@ tcp_close(tp)
        sbfree(&so->so_rcv);
        sbfree(&so->so_snd);
        sofree(so);
-       tcpstat.tcps_closed++;
+       STAT(tcpstat.tcps_closed++);
        return ((struct tcpcb *)0);
 }
 
@@ -528,7 +528,7 @@ tcp_connect(inso)
  */
 
 /*     soisconnecting(so); */ /* NOFDREF used instead */
-       tcpstat.tcps_connattempt++;
+       STAT(tcpstat.tcps_connattempt++);
 
        tp->t_state = TCPS_SYN_SENT;
        tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
@@ -857,7 +857,7 @@ tcp_emu(so, m)
 
                 /*soisfconnecting(ns);*/
 
-                               tcpstat.tcps_connattempt++;
+                               STAT(tcpstat.tcps_connattempt++);
 
                                tp->t_state = TCPS_SYN_SENT;
                                tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;