mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Review with Simon: Remove dead code (since 2003)
This commit is contained in:
parent
50303eea23
commit
0106cf7ae0
@ -1034,30 +1034,7 @@ udp_connect(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port)
|
||||
ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr);
|
||||
pcb->remote_port = port;
|
||||
pcb->flags |= UDP_FLAGS_CONNECTED;
|
||||
/** TODO: this functionality belongs in upper layers */
|
||||
#ifdef LWIP_UDP_TODO
|
||||
#if LWIP_IPV6
|
||||
if (!IP_IS_V6_VAL(pcb->remote_ip))
|
||||
#endif /* LWIP_IPV6 */
|
||||
{
|
||||
/* Nail down local IP for netconn_addr()/getsockname() */
|
||||
if (ip_addr_isany(&pcb->local_ip) && !ip_addr_isany(&pcb->remote_ip)) {
|
||||
struct netif *netif;
|
||||
|
||||
if ((netif = ip_route(IP_IS_V6_VAL(pcb->remote_ip), (const ip_addr_t*)NULL, &pcb->remote_ip)) == NULL) {
|
||||
LWIP_DEBUGF(UDP_DEBUG, ("udp_connect: No route to %s\n", ipaddr_ntoa(&pcb->remote_ip)));
|
||||
UDP_STATS_INC(udp.rterr);
|
||||
return ERR_RTE;
|
||||
}
|
||||
/** TODO: this will bind the udp pcb locally, to the interface which
|
||||
is used to route output packets to the remote address. However, we
|
||||
might want to accept incoming packets on any interface! */
|
||||
ip_addr_set(&pcb->local_ip, ip_netif_get_local_ip(IP_IS_V6_VAL(pcb->remote_ip), netif, &pcb->remote_ip));
|
||||
} else if (ip_addr_isany(&pcb->remote_ip)) {
|
||||
ip_addr_set_any(IP_IS_V6_VAL(pcb->remote_ip), &pcb->local_ip);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_connect: connected to "));
|
||||
ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
|
||||
&pcb->remote_ip);
|
||||
|
Loading…
Reference in New Issue
Block a user