From b54c7bedfd66150e8d5d86e7a651ab22456a9919 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 27 Mar 2011 13:36:32 +0000 Subject: [PATCH] Fixed bug #32906: lwip_connect+lwip_send did not work for udp and raw pcbs with LWIP_TCPIP_CORE_LOCKING==1. --- CHANGELOG | 4 ++++ src/api/sockets.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 475fd153..5f0711e4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -237,6 +237,10 @@ HISTORY ++ Bugfixes: + 2011-03-27: Simon Goldschmidt + * sockets.c: Fixed bug #32906: lwip_connect+lwip_send did not work for udp and + raw pcbs with LWIP_TCPIP_CORE_LOCKING==1. + 2011-03-27: Simon Goldschmidt * tcp_out.c: Fixed bug #32820 (Outgoing TCP connections created before route is present never times out) by starting retransmission timer before checking diff --git a/src/api/sockets.c b/src/api/sockets.c index 9d44a408..bfef2d96 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -847,8 +847,12 @@ lwip_sendto(int s, const void *data, size_t size, int flags, inet_addr_to_ipaddr_p(remote_addr, &to_in->sin_addr); remote_port = ntohs(to_in->sin_port); } else { - remote_addr = IP_ADDR_ANY; - remote_port = 0; + remote_addr = &sock->conn->pcb.raw->remote_ip; + if (sock->conn->type == NETCONN_RAW) { + remote_port = 0; + } else { + remote_port = sock->conn->pcb.udp->remote_port; + } } LOCK_TCPIP_CORE();