mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
netif: Move LWIP_ASSERT_CORE_LOCKED out of static functions
The netif_do_set_{ipaddr|netmask|gw} are static functions what won't be called directly, thus move LWIP_ASSERT_CORE_LOCKED to netif_set_{ipaddr|netmask|gw}. This avoid duplicated LWIP_ASSERT_CORE_LOCKED checking by netif_set_addr(). Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
25f1c6ef2c
commit
2cb220d7fe
@ -426,8 +426,6 @@ netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, u8_t callback
|
|||||||
{
|
{
|
||||||
ip_addr_t new_addr;
|
ip_addr_t new_addr;
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
|
||||||
|
|
||||||
*ip_2_ip4(&new_addr) = (ipaddr ? *ipaddr : *IP4_ADDR_ANY4);
|
*ip_2_ip4(&new_addr) = (ipaddr ? *ipaddr : *IP4_ADDR_ANY4);
|
||||||
IP_SET_TYPE_VAL(new_addr, IPADDR_TYPE_V4);
|
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
|
void
|
||||||
netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr)
|
netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr)
|
||||||
{
|
{
|
||||||
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
|
|
||||||
netif_do_set_ipaddr(netif, ipaddr, 1);
|
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;
|
args.ipv4_nm_changed.old_address = &old_addr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
|
||||||
|
|
||||||
/* address is actually being changed? */
|
/* address is actually being changed? */
|
||||||
if (ip4_addr_cmp(safe_netmask, netif_ip4_netmask(netif)) == 0) {
|
if (ip4_addr_cmp(safe_netmask, netif_ip4_netmask(netif)) == 0) {
|
||||||
mib2_remove_route_ip4(0, netif);
|
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
|
void
|
||||||
netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask)
|
netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask)
|
||||||
{
|
{
|
||||||
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
|
|
||||||
netif_do_set_netmask(netif, netmask, 1);
|
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;
|
args.ipv4_gw_changed.old_address = &old_addr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
|
||||||
|
|
||||||
/* address is actually being changed? */
|
/* address is actually being changed? */
|
||||||
if (ip4_addr_cmp(safe_gw, netif_ip4_gw(netif)) == 0) {
|
if (ip4_addr_cmp(safe_gw, netif_ip4_gw(netif)) == 0) {
|
||||||
ip4_addr_set(ip_2_ip4(&netif->gw), gw);
|
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
|
void
|
||||||
netif_set_gw(struct netif *netif, const ip4_addr_t *gw)
|
netif_set_gw(struct netif *netif, const ip4_addr_t *gw)
|
||||||
{
|
{
|
||||||
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
|
|
||||||
netif_do_set_gw(netif, gw, 1);
|
netif_do_set_gw(netif, gw, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user