mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 23:15:37 +00:00
netif_add: avoid passing NULL pointers to subsequent functions (reported by Axel Lin)
This commit is contained in:
parent
9bbb741247
commit
5967380c20
@ -281,6 +281,16 @@ netif_add(struct netif *netif,
|
||||
|
||||
LWIP_ASSERT("No init function given", init != NULL);
|
||||
|
||||
if (ipaddr == NULL) {
|
||||
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
|
||||
}
|
||||
if (netmask == NULL) {
|
||||
netmask = ip_2_ip4(IP4_ADDR_ANY);
|
||||
}
|
||||
if (gw == NULL) {
|
||||
gw = ip_2_ip4(IP4_ADDR_ANY);
|
||||
}
|
||||
|
||||
/* reset new interface configuration state */
|
||||
#if LWIP_IPV4
|
||||
ip_addr_set_zero_ip4(&netif->ip_addr);
|
||||
|
Loading…
Reference in New Issue
Block a user