From 10189332cd4a72e9ddad60af140cdceaf6cb5437 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 29 May 2019 13:03:34 +0800 Subject: [PATCH] net: if: Make IPv4 address const in removal function As the function does not touch IPv4 address in removal, we can mark it const. Signed-off-by: Jukka Rissanen --- include/net/net_if.h | 2 +- subsys/net/ip/net_if.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/net_if.h b/include/net/net_if.h index bbb780ff725..5770d97ac94 100644 --- a/include/net/net_if.h +++ b/include/net/net_if.h @@ -1476,7 +1476,7 @@ struct net_if_addr *net_if_ipv4_addr_add(struct net_if *iface, * * @return True if successfully removed, false otherwise */ -bool net_if_ipv4_addr_rm(struct net_if *iface, struct in_addr *addr); +bool net_if_ipv4_addr_rm(struct net_if *iface, const struct in_addr *addr); /** * @brief Check if this IPv4 address belongs to one of the interface indices. diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index 825c6fa071e..7b76aff8a3e 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -2687,7 +2687,7 @@ struct net_if_addr *net_if_ipv4_addr_add(struct net_if *iface, return NULL; } -bool net_if_ipv4_addr_rm(struct net_if *iface, struct in_addr *addr) +bool net_if_ipv4_addr_rm(struct net_if *iface, const struct in_addr *addr) { #if defined(CONFIG_NET_IPV4) struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4;