410 |
/* chksum zero must become 0xffff, as zero means 'no checksum' */ |
/* chksum zero must become 0xffff, as zero means 'no checksum' */ |
411 |
if(udphdr->chksum == 0x0000) udphdr->chksum = 0xffff; |
if(udphdr->chksum == 0x0000) udphdr->chksum = 0xffff; |
412 |
} |
} |
413 |
DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum %x\n", udphdr->chksum)); |
DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04x\n", udphdr->chksum)); |
414 |
snmp_inc_udpoutdatagrams(); |
snmp_inc_udpoutdatagrams(); |
415 |
DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if(,,,,IP_PROTO_UDP,)\n")); |
DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if(,,,,IP_PROTO_UDP,)\n")); |
416 |
/* output to IP */ |
/* output to IP */ |
417 |
err = ip_output_if(q, src_ip, &pcb->remote_ip, UDP_TTL, IP_PROTO_UDP, netif); |
err = ip_output_if(q, src_ip, &pcb->remote_ip, UDP_TTL, IP_PROTO_UDP, netif); |
418 |
} |
} |
419 |
|
|
420 |
/* did we chain a header? */ |
/* did we chain a header earlier? */ |
421 |
if (q != p) { |
if (q != p) { |
422 |
/* free the header */ |
/* free the header */ |
423 |
pbuf_free(q); |
pbuf_free(q); |
504 |
pcb->next = udp_pcbs; |
pcb->next = udp_pcbs; |
505 |
udp_pcbs = pcb; |
udp_pcbs = pcb; |
506 |
} |
} |
507 |
DEBUGF(UDP_DEBUG, ("udp_bind: bound to port %u\n", port)); |
DEBUGF(UDP_DEBUG | DBG_TRACE | DBG_STATE, ("udp_bind: bound to %u.%u.%u.%u, port %u\n", |
508 |
|
(u8_t)(ntohl(ipaddr->addr) >> 24 & 0xff), |
509 |
|
(u8_t)(ntohl(ipaddr->addr) >> 16 & 0xff), |
510 |
|
(u8_t)(ntohl(ipaddr->addr) >> 8 & 0xff), |
511 |
|
(u8_t)(ntohl(ipaddr->addr) & 0xff), port)); |
512 |
return ERR_OK; |
return ERR_OK; |
513 |
} |
} |
514 |
/** |
/** |