diff options
| author | bernard.xiong <[email protected]> | 2010-01-13 03:22:23 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-01-13 03:22:23 +0000 |
| commit | a27f7c67bd51c93dfed233adc371d6f178ff7b73 (patch) | |
| tree | 746823bd3b601ce9fe738a7b97875cd0ad7481d9 /net/lwip/src/api/api_msg.c | |
| parent | ce10330d8044964445c9bb0876dd8553a934da2c (diff) | |
update lwip to 1.3.2
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@297 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'net/lwip/src/api/api_msg.c')
| -rw-r--r-- | net/lwip/src/api/api_msg.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/lwip/src/api/api_msg.c b/net/lwip/src/api/api_msg.c index 28d1010193..46c9abf297 100644 --- a/net/lwip/src/api/api_msg.c +++ b/net/lwip/src/api/api_msg.c @@ -168,6 +168,15 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p, buf->ptr = p; buf->addr = addr; buf->port = port; +#if LWIP_NETBUF_RECVINFO + { + const struct ip_hdr* iphdr = ip_current_header(); + /* get the UDP header - always in the first pbuf, ensured by udp_input */ + const struct udp_hdr* udphdr = (void*)(((char*)iphdr) + IPH_LEN(iphdr)); + buf->toaddr = (struct ip_addr*)&iphdr->dest; + buf->toport = udphdr->dest; + } +#endif /* LWIP_NETBUF_RECVINFO */ } if (sys_mbox_trypost(conn->recvmbox, buf) != ERR_OK) { @@ -807,6 +816,8 @@ do_connect(struct api_msg_msg *msg) break; #endif /* LWIP_TCP */ default: + LWIP_ERROR("Invalid netconn type", 0, do{ msg->conn->err = ERR_VAL; + sys_sem_signal(msg->conn->op_completed); }while(0)); break; } } @@ -1149,7 +1160,7 @@ do_close(struct api_msg_msg *msg) #endif /* LWIP_TCP */ { msg->conn->err = ERR_VAL; - TCPIP_APIMSG_ACK(msg); + sys_sem_signal(msg->conn->op_completed); } } |
