mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Slightly improve raw_remove()/udp_remove() implementation
There should be no duplicate pcb in raw_pcbs/udp_pcbs list. So the implementation of raw_remove()/udp_remove() can break from the for loop once the target pcb is found and removed from the list. Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
3f49b85680
commit
21b9b5e741
@ -383,6 +383,7 @@ raw_remove(struct raw_pcb *pcb)
|
||||
if (pcb2->next != NULL && pcb2->next == pcb) {
|
||||
/* remove pcb from list */
|
||||
pcb2->next = pcb->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1131,6 +1131,7 @@ udp_remove(struct udp_pcb *pcb)
|
||||
if (pcb2->next != NULL && pcb2->next == pcb) {
|
||||
/* remove pcb from list */
|
||||
pcb2->next = pcb->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user