mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
udp: restructure udp_input uncon_pcb selection in preparation for fixing bug #53301
This commit is contained in:
parent
47ebb2b267
commit
1bdc669b45
@ -261,15 +261,17 @@ 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) {
|
||||||
|
/* the first unconnected matching PCB */
|
||||||
|
uncon_pcb = pcb;
|
||||||
|
}
|
||||||
#if SO_REUSE
|
#if SO_REUSE
|
||||||
/* prefer specific IPs over cath-all */
|
else if (!ip_addr_isany(&pcb->local_ip)) {
|
||||||
|| !ip_addr_isany(&pcb->local_ip)
|
/* prefer specific IPs over catch-all */
|
||||||
|
uncon_pcb = pcb;
|
||||||
|
}
|
||||||
#endif /* SO_REUSE */
|
#endif /* SO_REUSE */
|
||||||
)) {
|
|
||||||
/* the first unconnected matching PCB */
|
|
||||||
uncon_pcb = pcb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compare PCB remote addr+port to UDP source addr+port */
|
/* compare PCB remote addr+port to UDP source addr+port */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user