mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-05 14:04:38 +08:00
Minor code cleanup in udp.c
This commit is contained in:
parent
b5cd90a342
commit
2d80af1dcb
@ -154,11 +154,11 @@ udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
|
|||||||
|
|
||||||
/* Dual-stack: PCBs listening to any IP type also listen to any IP address */
|
/* Dual-stack: PCBs listening to any IP type also listen to any IP address */
|
||||||
if(IP_IS_ANY_TYPE_VAL(pcb->local_ip)) {
|
if(IP_IS_ANY_TYPE_VAL(pcb->local_ip)) {
|
||||||
#if IP_SOF_BROADCAST_RECV
|
#if LWIP_IPV4 && IP_SOF_BROADCAST_RECV
|
||||||
if(broadcast && !ip_get_option(pcb, SOF_BROADCAST)) {
|
if((broadcast != 0) && !ip_get_option(pcb, SOF_BROADCAST)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* IP_SOF_BROADCAST_RECV */
|
#endif /* LWIP_IPV4 && IP_SOF_BROADCAST_RECV */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +182,6 @@ udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif /* LWIP_IPV4 */
|
#endif /* LWIP_IPV4 */
|
||||||
{
|
|
||||||
/* Handle IPv4 and IPv6: all, multicast or exact match */
|
/* Handle IPv4 and IPv6: all, multicast or exact match */
|
||||||
if(ip_addr_isany(&pcb->local_ip) ||
|
if(ip_addr_isany(&pcb->local_ip) ||
|
||||||
#if LWIP_IPV6_MLD
|
#if LWIP_IPV6_MLD
|
||||||
@ -195,7 +194,6 @@ udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1123,7 +1121,7 @@ udp_new(void)
|
|||||||
/**
|
/**
|
||||||
* Create a UDP PCB for specific IP type.
|
* Create a UDP PCB for specific IP type.
|
||||||
*
|
*
|
||||||
* @param IP address type, see IPADDR_TYPE_XX definitions.
|
* @param type IP address type, see IPADDR_TYPE_XX definitions.
|
||||||
* @return The UDP PCB which was created. NULL if the PCB data structure
|
* @return The UDP PCB which was created. NULL if the PCB data structure
|
||||||
* could not be allocated.
|
* could not be allocated.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user