mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-12-10 08:46:40 +08:00
Patch #1625. Check ipaddr != NULL, also in ip_addr_debug_print() macro.
This commit is contained in:
parent
d61b274a09
commit
a9cd9d185c
@ -457,7 +457,9 @@ udp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
|
||||
{
|
||||
struct udp_pcb *ipcb;
|
||||
u8_t rebind;
|
||||
LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | 3, ("udp_bind(ipaddr = %lx, port = %u)\n", ipaddr->addr, port));
|
||||
LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | 3, ("udp_bind(ipaddr = "));
|
||||
ip_addr_debug_print(UDP_DEBUG, ipaddr);
|
||||
LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | 3, (", port = %u)\n", port));
|
||||
rebind = 0;
|
||||
/* Check for double bind and rebind of the same pcb */
|
||||
for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
|
||||
|
||||
@ -119,10 +119,10 @@ extern const struct ip_addr ip_addr_broadcast;
|
||||
|
||||
|
||||
#define ip_addr_debug_print(debug, ipaddr) LWIP_DEBUGF(debug, ("%u.%u.%u.%u", \
|
||||
(unsigned int)(ntohl((ipaddr)->addr) >> 24) & 0xff, \
|
||||
(unsigned int)(ntohl((ipaddr)->addr) >> 16) & 0xff, \
|
||||
(unsigned int)(ntohl((ipaddr)->addr) >> 8) & 0xff, \
|
||||
(unsigned int)ntohl((ipaddr)->addr) & 0xff))
|
||||
ipaddr?(unsigned int)(ntohl((ipaddr)->addr) >> 24) & 0xff:0, \
|
||||
ipaddr?(unsigned int)(ntohl((ipaddr)->addr) >> 16) & 0xff:0, \
|
||||
ipaddr?(unsigned int)(ntohl((ipaddr)->addr) >> 8) & 0xff:0, \
|
||||
ipaddr?(unsigned int)ntohl((ipaddr)->addr) & 0xff:0U))
|
||||
|
||||
/* cast to unsigned int, as it is used as argument to printf functions
|
||||
* which expect integer arguments */
|
||||
|
||||
@ -38,8 +38,6 @@
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
#define UDP_HLEN 8
|
||||
|
||||
struct udp_hdr {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user