Revision 31a60e22 slirp/udp.c
b/slirp/udp.c | ||
---|---|---|
45 | 45 |
#include <slirp.h> |
46 | 46 |
#include "ip_icmp.h" |
47 | 47 |
|
48 |
#ifdef LOG_ENABLED |
|
48 | 49 |
struct udpstat udpstat; |
50 |
#endif |
|
49 | 51 |
|
50 | 52 |
struct socket udb; |
51 | 53 |
|
... | ... | |
86 | 88 |
DEBUG_ARG("m = %lx", (long)m); |
87 | 89 |
DEBUG_ARG("iphlen = %d", iphlen); |
88 | 90 |
|
89 |
udpstat.udps_ipackets++;
|
|
91 |
STAT(udpstat.udps_ipackets++);
|
|
90 | 92 |
|
91 | 93 |
/* |
92 | 94 |
* Strip IP options, if any; should skip this, |
... | ... | |
113 | 115 |
|
114 | 116 |
if (ip->ip_len != len) { |
115 | 117 |
if (len > ip->ip_len) { |
116 |
udpstat.udps_badlen++;
|
|
118 |
STAT(udpstat.udps_badlen++);
|
|
117 | 119 |
goto bad; |
118 | 120 |
} |
119 | 121 |
m_adj(m, len - ip->ip_len); |
... | ... | |
140 | 142 |
* if (uh->uh_sum) { |
141 | 143 |
*/ |
142 | 144 |
if(cksum(m, len + sizeof(struct ip))) { |
143 |
udpstat.udps_badsum++;
|
|
145 |
STAT(udpstat.udps_badsum++);
|
|
144 | 146 |
goto bad; |
145 | 147 |
} |
146 | 148 |
} |
... | ... | |
181 | 183 |
if (tmp == &udb) { |
182 | 184 |
so = NULL; |
183 | 185 |
} else { |
184 |
udpstat.udpps_pcbcachemiss++;
|
|
186 |
STAT(udpstat.udpps_pcbcachemiss++);
|
|
185 | 187 |
udp_last_so = so; |
186 | 188 |
} |
187 | 189 |
} |
... | ... | |
299 | 301 |
((struct ip *)ui)->ip_ttl = ip_defttl; |
300 | 302 |
((struct ip *)ui)->ip_tos = iptos; |
301 | 303 |
|
302 |
udpstat.udps_opackets++;
|
|
304 |
STAT(udpstat.udps_opackets++);
|
|
303 | 305 |
|
304 | 306 |
error = ip_output(so, m); |
305 | 307 |
|
Also available in: Unified diff