mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
udp: restructure udp_input uncon_pcb selection in preparation for fixing bug #53301
This commit is contained in:
parent
47ebb2b267
commit
1bdc669b45
@ -261,16 +261,18 @@ udp_input(struct pbuf *p, struct netif *inp)
|
|||||||
/* compare PCB local addr+port to UDP destination addr+port */
|
/* compare PCB local addr+port to UDP destination addr+port */
|
||||||
if ((pcb->local_port == dest) &&
|
if ((pcb->local_port == dest) &&
|
||||||
(udp_input_local_match(pcb, inp, broadcast) != 0)) {
|
(udp_input_local_match(pcb, inp, broadcast) != 0)) {
|
||||||
if (((pcb->flags & UDP_FLAGS_CONNECTED) == 0) &&
|
if ((pcb->flags & UDP_FLAGS_CONNECTED) == 0) {
|
||||||
((uncon_pcb == NULL)
|
if (uncon_pcb == NULL) {
|
||||||
#if SO_REUSE
|
|
||||||
/* prefer specific IPs over cath-all */
|
|
||||||
|| !ip_addr_isany(&pcb->local_ip)
|
|
||||||
#endif /* SO_REUSE */
|
|
||||||
)) {
|
|
||||||
/* the first unconnected matching PCB */
|
/* the first unconnected matching PCB */
|
||||||
uncon_pcb = pcb;
|
uncon_pcb = pcb;
|
||||||
}
|
}
|
||||||
|
#if SO_REUSE
|
||||||
|
else if (!ip_addr_isany(&pcb->local_ip)) {
|
||||||
|
/* prefer specific IPs over catch-all */
|
||||||
|
uncon_pcb = pcb;
|
||||||
|
}
|
||||||
|
#endif /* SO_REUSE */
|
||||||
|
}
|
||||||
|
|
||||||
/* compare PCB remote addr+port to UDP source addr+port */
|
/* compare PCB remote addr+port to UDP source addr+port */
|
||||||
if ((pcb->remote_port == src) &&
|
if ((pcb->remote_port == src) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user