mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +00:00
Make udp_disconnect() clear its remote address association.
This commit is contained in:
parent
79c7a7a43d
commit
bfdf19f56c
@ -272,6 +272,11 @@ level of complexity of UDP, the interface is significantly simpler.
|
|||||||
Sets the remote end of the pcb. This function does not generate any
|
Sets the remote end of the pcb. This function does not generate any
|
||||||
network traffic, but only set the remote address of the pcb.
|
network traffic, but only set the remote address of the pcb.
|
||||||
|
|
||||||
|
- err_t udp_disconnect(struct udp_pcb *pcb)
|
||||||
|
|
||||||
|
Remove the remote end of the pcb. This function does not generate
|
||||||
|
any network traffic, but only removes the remote address of the pcb.
|
||||||
|
|
||||||
- err_t udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
- err_t udp_send(struct udp_pcb *pcb, struct pbuf *p)
|
||||||
|
|
||||||
Sends the pbuf p. The pbuf is not deallocated.
|
Sends the pbuf p. The pbuf is not deallocated.
|
||||||
|
@ -703,6 +703,10 @@ udp_connect(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
|
|||||||
void
|
void
|
||||||
udp_disconnect(struct udp_pcb *pcb)
|
udp_disconnect(struct udp_pcb *pcb)
|
||||||
{
|
{
|
||||||
|
/* reset remote address association */
|
||||||
|
ip_addr_set(&pcb->remote_ip, IP_ADDR_ANY);
|
||||||
|
pcb->remote_port = 0;
|
||||||
|
/* mark PCB as unconnected */
|
||||||
pcb->flags &= ~UDP_FLAGS_CONNECTED;
|
pcb->flags &= ~UDP_FLAGS_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ typedef s8_t err_t;
|
|||||||
#define ERR_USE -10 /* Address in use. */
|
#define ERR_USE -10 /* Address in use. */
|
||||||
|
|
||||||
#define ERR_IF -11 /* Low-level netif error */
|
#define ERR_IF -11 /* Low-level netif error */
|
||||||
|
#define ERR_ISCONN -12 /* Already connected. */
|
||||||
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
#ifdef LWIP_DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user