diff --git a/src/core/netif.c b/src/core/netif.c index 6f9f99a6..375ee433 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -426,8 +426,6 @@ netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, u8_t callback { ip_addr_t new_addr; - LWIP_ASSERT_CORE_LOCKED(); - *ip_2_ip4(&new_addr) = (ipaddr ? *ipaddr : *IP4_ADDR_ANY4); IP_SET_TYPE_VAL(new_addr, IPADDR_TYPE_V4); @@ -481,6 +479,8 @@ netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, u8_t callback void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr) { + LWIP_ASSERT_CORE_LOCKED(); + netif_do_set_ipaddr(netif, ipaddr, 1); } @@ -495,8 +495,6 @@ netif_do_set_netmask(struct netif *netif, const ip4_addr_t *netmask, u8_t callba args.ipv4_nm_changed.old_address = &old_addr; #endif - LWIP_ASSERT_CORE_LOCKED(); - /* address is actually being changed? */ if (ip4_addr_cmp(safe_netmask, netif_ip4_netmask(netif)) == 0) { mib2_remove_route_ip4(0, netif); @@ -530,6 +528,8 @@ netif_do_set_netmask(struct netif *netif, const ip4_addr_t *netmask, u8_t callba void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask) { + LWIP_ASSERT_CORE_LOCKED(); + netif_do_set_netmask(netif, netmask, 1); } @@ -544,8 +544,6 @@ netif_do_set_gw(struct netif *netif, const ip4_addr_t *gw, u8_t callback) args.ipv4_gw_changed.old_address = &old_addr; #endif - LWIP_ASSERT_CORE_LOCKED(); - /* address is actually being changed? */ if (ip4_addr_cmp(safe_gw, netif_ip4_gw(netif)) == 0) { ip4_addr_set(ip_2_ip4(&netif->gw), gw); @@ -575,6 +573,8 @@ netif_do_set_gw(struct netif *netif, const ip4_addr_t *gw, u8_t callback) void netif_set_gw(struct netif *netif, const ip4_addr_t *gw) { + LWIP_ASSERT_CORE_LOCKED(); + netif_do_set_gw(netif, gw, 1); }