Revision 31a60e22 slirp/ip_icmp.c

b/slirp/ip_icmp.c
37 37
#include "slirp.h"
38 38
#include "ip_icmp.h"
39 39

  
40
#ifdef LOG_ENABLED
40 41
struct icmpstat icmpstat;
42
#endif
41 43

  
42 44
/* The message sent when emulating PING */
43 45
/* Be nice and tell them it's just a psuedo-ping packet */
......
83 85
  DEBUG_ARG("m = %lx", (long )m);
84 86
  DEBUG_ARG("m_len = %d", m->m_len);
85 87

  
86
  icmpstat.icps_received++;
88
  STAT(icmpstat.icps_received++);
87 89

  
88 90
  /*
89 91
   * Locate icmp structure in mbuf, and check
90 92
   * that its not corrupted and of at least minimum length.
91 93
   */
92 94
  if (icmplen < ICMP_MINLEN) {          /* min 8 bytes payload */
93
    icmpstat.icps_tooshort++;
95
    STAT(icmpstat.icps_tooshort++);
94 96
  freeit:
95 97
    m_freem(m);
96 98
    goto end_error;
......
100 102
  m->m_data += hlen;
101 103
  icp = mtod(m, struct icmp *);
102 104
  if (cksum(m, icmplen)) {
103
    icmpstat.icps_checksum++;
105
    STAT(icmpstat.icps_checksum++);
104 106
    goto freeit;
105 107
  }
106 108
  m->m_len += hlen;
......
170 172
  case ICMP_TSTAMP:
171 173
  case ICMP_MASKREQ:
172 174
  case ICMP_REDIRECT:
173
    icmpstat.icps_notsupp++;
175
    STAT(icmpstat.icps_notsupp++);
174 176
    m_freem(m);
175 177
    break;
176 178

  
177 179
  default:
178
    icmpstat.icps_badtype++;
180
    STAT(icmpstat.icps_badtype++);
179 181
    m_freem(m);
180 182
  } /* swith */
181 183

  
......
314 316

  
315 317
  (void ) ip_output((struct socket *)NULL, m);
316 318

  
317
  icmpstat.icps_reflect++;
319
  STAT(icmpstat.icps_reflect++);
318 320

  
319 321
end_error:
320 322
  return;
......
371 373

  
372 374
  (void ) ip_output((struct socket *)NULL, m);
373 375

  
374
  icmpstat.icps_reflect++;
376
  STAT(icmpstat.icps_reflect++);
375 377
}

Also available in: Unified diff