fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr

This commit is contained in:
Simon Goldschmidt
2011-08-24 19:52:06 +02:00
parent ed0626afeb
commit bf4ec9be22
2 changed files with 4 additions and 1 deletions

View File

@@ -358,7 +358,7 @@ netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
struct tcp_pcb_listen *lpcb;
/* address is actually being changed? */
if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
if (ipaddr && (ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
/* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
pcb = tcp_active_pcbs;