50 |
struct icmp_echo_hdr *iecho; |
struct icmp_echo_hdr *iecho; |
51 |
struct ip_hdr *iphdr; |
struct ip_hdr *iphdr; |
52 |
struct ip_addr tmpaddr; |
struct ip_addr tmpaddr; |
|
|
|
53 |
|
|
54 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
55 |
++lwip_stats.icmp.recv; |
++lwip_stats.icmp.recv; |
56 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
57 |
|
|
58 |
|
/* TODO: check length before accessing payload! */ |
59 |
|
|
60 |
type = ((char *)p->payload)[0]; |
type = ((char *)p->payload)[0]; |
61 |
|
|
62 |
switch (type) { |
switch (type) { |
104 |
iphdr->hoplim, IP_PROTO_ICMP, inp); |
iphdr->hoplim, IP_PROTO_ICMP, inp); |
105 |
break; |
break; |
106 |
default: |
default: |
107 |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type not supported.\n")); |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %d not supported.\n", (int)type)); |
|
|
|
108 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
109 |
++lwip_stats.icmp.proterr; |
++lwip_stats.icmp.proterr; |
110 |
++lwip_stats.icmp.drop; |
++lwip_stats.icmp.drop; |