Skip to content
Permalink
Browse files

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 <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Jun 19, 2019
1 parent 7063921 commit 766ad9f96c4be4366da89427e5974cfdcc26fc5d
Showing with 2 additions and 2 deletions.
  1. +1 −1 include/net/net_if.h
  2. +1 −1 subsys/net/ip/net_if.c
@@ -1672,7 +1672,7 @@ __syscall bool net_if_ipv4_set_netmask_by_index(int index,
* @param iface Interface to use.
* @param gw IPv4 address of an gateway
*/
void net_if_ipv4_set_gw(struct net_if *iface, struct in_addr *gw);
void net_if_ipv4_set_gw(struct net_if *iface, const struct in_addr *gw);

/**
* @brief Set IPv4 gateway for an interface index.
@@ -2644,7 +2644,7 @@ Z_SYSCALL_HANDLER(net_if_ipv4_set_netmask_by_index, index, netmask)
}
#endif /* CONFIG_USERSPACE */

void net_if_ipv4_set_gw(struct net_if *iface, struct in_addr *gw)
void net_if_ipv4_set_gw(struct net_if *iface, const struct in_addr *gw)
{
#if defined(CONFIG_NET_IPV4)
if (net_if_config_ipv4_get(iface, NULL) < 0) {

0 comments on commit 766ad9f

Please sign in to comment.
You can’t perform that action at this time.