Skip to content

Commit 766ad9f

Browse files
committed
net: if: Make gateway address in net_if_ipv4_set_gw() const
As the function does not modify the parameter, we can make it const. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 7063921 commit 766ad9f

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
@@ -1672,7 +1672,7 @@ __syscall bool net_if_ipv4_set_netmask_by_index(int index,
16721672
* @param iface Interface to use.
16731673
* @param gw IPv4 address of an gateway
16741674
*/
1675-
void net_if_ipv4_set_gw(struct net_if *iface, struct in_addr *gw);
1675+
void net_if_ipv4_set_gw(struct net_if *iface, const struct in_addr *gw);
16761676

16771677
/**
16781678
* @brief Set IPv4 gateway for an interface index.

subsys/net/ip/net_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2644,7 +2644,7 @@ Z_SYSCALL_HANDLER(net_if_ipv4_set_netmask_by_index, index, netmask)
26442644
}
26452645
#endif /* CONFIG_USERSPACE */
26462646

2647-
void net_if_ipv4_set_gw(struct net_if *iface, struct in_addr *gw)
2647+
void net_if_ipv4_set_gw(struct net_if *iface, const struct in_addr *gw)
26482648
{
26492649
#if defined(CONFIG_NET_IPV4)
26502650
if (net_if_config_ipv4_get(iface, NULL) < 0) {

0 commit comments

Comments
 (0)