53 |
|
|
54 |
|
|
55 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
56 |
++stats.icmp.recv; |
++lwip_stats.icmp.recv; |
57 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
58 |
|
|
59 |
type = ((char *)p->payload)[0]; |
type = ((char *)p->payload)[0]; |
67 |
|
|
68 |
pbuf_free(p); |
pbuf_free(p); |
69 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
70 |
++stats.icmp.lenerr; |
++lwip_stats.icmp.lenerr; |
71 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
72 |
|
|
73 |
return; |
return; |
78 |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%x)\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len))); |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%x)\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len))); |
79 |
|
|
80 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
81 |
++stats.icmp.chkerr; |
++lwip_stats.icmp.chkerr; |
82 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
83 |
/* return;*/ |
/* return;*/ |
84 |
} |
} |
95 |
} |
} |
96 |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%x)\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len))); |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%x)\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len))); |
97 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
98 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
99 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
100 |
|
|
101 |
/* DEBUGF("icmp: p->len %d p->tot_len %d\n", p->len, p->tot_len);*/ |
/* DEBUGF("icmp: p->len %d p->tot_len %d\n", p->len, p->tot_len);*/ |
106 |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type not supported.\n")); |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type not supported.\n")); |
107 |
|
|
108 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
109 |
++stats.icmp.proterr; |
++lwip_stats.icmp.proterr; |
110 |
++stats.icmp.drop; |
++lwip_stats.icmp.drop; |
111 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
112 |
} |
} |
113 |
|
|
136 |
idur->chksum = 0; |
idur->chksum = 0; |
137 |
idur->chksum = inet_chksum(idur, q->len); |
idur->chksum = inet_chksum(idur, q->len); |
138 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
139 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
140 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
141 |
|
|
142 |
ip_output(q, NULL, |
ip_output(q, NULL, |
168 |
tehdr->chksum = 0; |
tehdr->chksum = 0; |
169 |
tehdr->chksum = inet_chksum(tehdr, q->len); |
tehdr->chksum = inet_chksum(tehdr, q->len); |
170 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
171 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
172 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
173 |
ip_output(q, NULL, |
ip_output(q, NULL, |
174 |
(struct ip_addr *)&(iphdr->src), ICMP_TTL, IP_PROTO_ICMP); |
(struct ip_addr *)&(iphdr->src), ICMP_TTL, IP_PROTO_ICMP); |