217 |
|
|
218 |
|
|
219 |
/* Check checksum if this is a match or if it was directed at us. */ |
/* Check checksum if this is a match or if it was directed at us. */ |
220 |
/* if(pcb != NULL || |
if(pcb != NULL || ip_addr_cmp(&inp->ip_addr, &iphdr->dest)) |
221 |
ip_addr_cmp(&inp->ip_addr, &iphdr->dest)) {*/ |
{ |
|
if(pcb != NULL) { |
|
222 |
DEBUGF(UDP_DEBUG, ("udp_input: calculating checksum\n")); |
DEBUGF(UDP_DEBUG, ("udp_input: calculating checksum\n")); |
223 |
pbuf_header(p, UDP_HLEN); |
pbuf_header(p, UDP_HLEN); |
224 |
#ifdef IPv6 |
#ifdef IPv6 |
265 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
266 |
snmp_inc_udpindatagrams(); |
snmp_inc_udpindatagrams(); |
267 |
#endif |
#endif |
268 |
pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src); |
pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), udphdr->src); |
269 |
} else { |
} else { |
270 |
DEBUGF(UDP_DEBUG, ("udp_input: not for us.\n")); |
DEBUGF(UDP_DEBUG, ("udp_input: not for us.\n")); |
271 |
|
|
275 |
if(!ip_addr_isbroadcast(&iphdr->dest, &inp->netmask) && |
if(!ip_addr_isbroadcast(&iphdr->dest, &inp->netmask) && |
276 |
!ip_addr_ismulticast(&iphdr->dest)) { |
!ip_addr_ismulticast(&iphdr->dest)) { |
277 |
|
|
|
/* deconvert from host to network byte order */ |
|
|
udphdr->src = htons(udphdr->src); |
|
|
udphdr->dest = htons(udphdr->dest); |
|
|
|
|
278 |
/* adjust pbuf pointer */ |
/* adjust pbuf pointer */ |
279 |
p->payload = iphdr; |
p->payload = iphdr; |
280 |
icmp_dest_unreach(p, ICMP_DUR_PORT); |
icmp_dest_unreach(p, ICMP_DUR_PORT); |