mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 14:11:02 +00:00
fixed bug #34072: UDP broadcast is received from wrong UDP pcb if udp port matches
This commit is contained in:
parent
378bed8a03
commit
72e2d16f14
@ -27,6 +27,10 @@ HISTORY
|
||||
|
||||
++ Bugfixes:
|
||||
|
||||
2011-09-09: Simon Goldschmidt
|
||||
* udp.c: fixed bug #34072: UDP broadcast is received from wrong UDP pcb if
|
||||
udp port matches
|
||||
|
||||
2011-09-03: Simon Goldschmidt
|
||||
* tcp_in.c: fixed bug #33952 PUSH flag in incoming packet is lost when packet
|
||||
is aggregated and sent to application
|
||||
|
@ -171,22 +171,26 @@ udp_input(struct pbuf *p, struct netif *inp)
|
||||
ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip), pcb->remote_port));
|
||||
|
||||
/* compare PCB local addr+port to UDP destination addr+port */
|
||||
if ((pcb->local_port == dest) &&
|
||||
((!broadcast && ip_addr_isany(&pcb->local_ip)) ||
|
||||
if (pcb->local_port == dest) {
|
||||
if (
|
||||
(!broadcast && ip_addr_isany(&pcb->local_ip)) ||
|
||||
ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest) ||
|
||||
#if LWIP_IGMP
|
||||
ip_addr_ismulticast(¤t_iphdr_dest) ||
|
||||
#endif /* LWIP_IGMP */
|
||||
#if IP_SOF_BROADCAST_RECV
|
||||
(broadcast && (pcb->so_options & SOF_BROADCAST)))) {
|
||||
#else /* IP_SOF_BROADCAST_RECV */
|
||||
(broadcast))) {
|
||||
#endif /* IP_SOF_BROADCAST_RECV */
|
||||
local_match = 1;
|
||||
if ((uncon_pcb == NULL) &&
|
||||
((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) {
|
||||
/* the first unconnected matching PCB */
|
||||
uncon_pcb = pcb;
|
||||
(broadcast && (pcb->so_options & SOF_BROADCAST) &&
|
||||
ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask))) {
|
||||
#else /* IP_SOF_BROADCAST_RECV */
|
||||
(broadcast &&
|
||||
ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask))) {
|
||||
#endif /* IP_SOF_BROADCAST_RECV */
|
||||
local_match = 1;
|
||||
if ((uncon_pcb == NULL) &&
|
||||
((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) {
|
||||
/* the first unconnected matching PCB */
|
||||
uncon_pcb = pcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* compare PCB remote addr+port to UDP source addr+port */
|
||||
|
Loading…
Reference in New Issue
Block a user