339 |
to be allocated. */ |
to be allocated. */ |
340 |
hdr = NULL; |
hdr = NULL; |
341 |
|
|
342 |
/* succeeding in adding an UDP header to first given pbuf in chain? */ |
/* not enough space to add an UDP header to first pbuf in given p chain? */ |
343 |
if(pbuf_header(p, UDP_HLEN)) { |
if(pbuf_header(p, UDP_HLEN)) { |
344 |
/* allocate header in new pbuf */ |
/* allocate header in new pbuf */ |
345 |
hdr = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM); |
hdr = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM); |
405 |
/* output to IP */ |
/* output to IP */ |
406 |
err = ip_output_if(p, src_ip, &pcb->remote_ip, UDP_TTL, IP_PROTO_UDP, netif); |
err = ip_output_if(p, src_ip, &pcb->remote_ip, UDP_TTL, IP_PROTO_UDP, netif); |
407 |
} |
} |
408 |
/* dechain and free the header pbuf */ |
/* dechain and free any header pbuf */ |
409 |
if(hdr != NULL) { |
if(hdr != NULL) { |
410 |
|
/* detach the header prepended earlier */ |
411 |
|
pbuf_dechain(hdr); |
412 |
|
/* free the header */ |
413 |
pbuf_free(hdr); |
pbuf_free(hdr); |
414 |
} |
} |
415 |
|
|