diff options
Diffstat (limited to 'stacks/lwip_stack/lwip_src/socket/stackx_udp.c')
-rw-r--r-- | stacks/lwip_stack/lwip_src/socket/stackx_udp.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/stacks/lwip_stack/lwip_src/socket/stackx_udp.c b/stacks/lwip_stack/lwip_src/socket/stackx_udp.c index 69b822b..1f382cf 100644 --- a/stacks/lwip_stack/lwip_src/socket/stackx_udp.c +++ b/stacks/lwip_stack/lwip_src/socket/stackx_udp.c @@ -182,16 +182,7 @@ sbr_udp_connect (sbr_socket_t * sk, const struct sockaddr *name, inet_addr_to_ipaddr (&remote_addr, &addr_in->sin_addr); u16 remote_port = addr_in->sin_port; - spl_ip_addr_t local_addr; - if (IPADDR_ANY == ss_get_local_ip (sbr_get_conn (sk))->addr) - { - if (sbr_get_src_ip (remote_addr.addr, &local_addr.addr) != 0) - { - sbr_set_sk_errno (sk, EHOSTUNREACH); - NSSBR_LOGERR ("get src ip failed]fd=%d", sk->fd); - return -1; - } - } + spl_ip_addr_t local_addr = { IPADDR_ANY }; return sbr_handle_connect (sk, &remote_addr, ntohs (remote_port), &local_addr); @@ -815,16 +806,7 @@ sbr_udp_senddata (sbr_socket_t * sk, const struct iovec *iov, int iovcnt, netbuf_fromport (&buf) = 0; } - spl_ip_addr_t local_ip; - if (IPADDR_ANY == ss_get_local_ip (sbr_get_conn (sk))->addr) - { - if (sbr_get_src_ip (buf.addr.addr, &local_ip.addr) != 0) - { - sbr_set_sk_io_errno (sk, EHOSTUNREACH); - NSSBR_LOGERR ("get src ip failed]fd=%d", sk->fd); - return -1; - } - } + spl_ip_addr_t local_ip = { IPADDR_ANY }; int err = ss_get_last_errno (sbr_get_conn (sk)); if (SPL_ERR_IS_FATAL (err)) |