Skip to content

Commit 1018933

Browse files
committed
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 <[email protected]>
1 parent 01fa8a6 commit 1018933

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/net/net_if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ struct net_if_addr *net_if_ipv4_addr_add(struct net_if *iface,
14761476
*
14771477
* @return True if successfully removed, false otherwise
14781478
*/
1479-
bool net_if_ipv4_addr_rm(struct net_if *iface, struct in_addr *addr);
1479+
bool net_if_ipv4_addr_rm(struct net_if *iface, const struct in_addr *addr);
14801480

14811481
/**
14821482
* @brief Check if this IPv4 address belongs to one of the interface indices.

subsys/net/ip/net_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ struct net_if_addr *net_if_ipv4_addr_add(struct net_if *iface,
26872687
return NULL;
26882688
}
26892689

2690-
bool net_if_ipv4_addr_rm(struct net_if *iface, struct in_addr *addr)
2690+
bool net_if_ipv4_addr_rm(struct net_if *iface, const struct in_addr *addr)
26912691
{
26922692
#if defined(CONFIG_NET_IPV4)
26932693
struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4;

0 commit comments

Comments
 (0)