eliminate temporary storage when using netif addresses for ip_addr_t* now that they have the correct type (ATTENTION: ip6_select_source_address() and ip4_netif_get_local_ip() now return ip_addr_t*!)

This commit is contained in:
goldsimon
2015-09-24 14:34:24 +02:00
parent 4d2f4ce78c
commit 262a641396
14 changed files with 30 additions and 78 deletions

View File

@@ -1198,13 +1198,11 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb)
/* If we don't have a local IP address, we get one from netif */
if (ip_addr_isany(&pcb->local_ip)) {
const ip_addr_t *local_ip = ip_netif_get_local_ip(PCB_ISIPV6(pcb), netif,
&pcb->remote_ip, &pcb->local_ip);
&pcb->remote_ip);
if (local_ip == NULL) {
return ERR_RTE;
}
#if !LWIP_IPV4 || !LWIP_IPV6
ip_addr_copy(pcb->local_ip, *local_ip);
#endif /* !LWIP_IPV4 || !LWIP_IPV6 */
}
if (pcb->rttest == 0) {