diff --git a/net/socket/connect.c b/net/socket/connect.c index 838cec0ba0..9e996093f5 100644 --- a/net/socket/connect.c +++ b/net/socket/connect.c @@ -511,7 +511,7 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr, #ifdef CONFIG_NET_UDP case SOCK_DGRAM: { - ret = udp_connect(psock->s_conn, inaddr); + ret = udp_connect(psock->s_conn, addr); if (ret < 0) { err = -ret; diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 0b678d1da0..394dca5d76 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -528,7 +528,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, /* Setup the UDP socket */ conn = (FAR struct udp_conn_s *)psock->s_conn; - ret = udp_connect(conn, into); + ret = udp_connect(conn, to); if (ret < 0) { net_unlock(save);