From be191148e080995dd0cde175aa19962b9e15f075 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 24 Aug 2011 19:52:06 +0200 Subject: [PATCH] fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr --- CHANGELOG | 3 +++ src/core/netif.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2af850c6..73dd9dd4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,9 @@ HISTORY ++ Bugfixes: + 2011-08-24: Simon Goldschmidt + * netif.c: fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr + 2011-08-22: Simon Goldschmidt * tcp_out.c: fixed bug #33962 TF_FIN not always set after FIN is sent. (This merely prevents nagle from not transmitting fast after closing.) diff --git a/src/core/netif.c b/src/core/netif.c index 2b1abf71..8b0d4839 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -326,7 +326,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;