summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-10-13 08:06:44 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-10-13 13:30:38 +0200
commitb1476b52100c01b4f4b936ed2d505a3a64a0b08e (patch)
tree5f43d474980a622d978d6c45f233d0b2c8f2cad7 /src
parentnetwork: read peer address, label, broadcast from rtnl message (diff)
downloadsystemd-b1476b52100c01b4f4b936ed2d505a3a64a0b08e.tar.xz
systemd-b1476b52100c01b4f4b936ed2d505a3a64a0b08e.zip
network: constify arguments
Diffstat (limited to '')
-rw-r--r--src/network/networkd-address.c14
-rw-r--r--src/network/networkd-address.h8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 930b6f1353..a6f8bcac14 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -17,7 +17,7 @@
#define ADDRESSES_PER_LINK_MAX 2048U
#define STATIC_ADDRESSES_PER_NETWORK_MAX 1024U
-int generate_ipv6_eui_64_address(Link *link, struct in6_addr *ret) {
+int generate_ipv6_eui_64_address(const Link *link, struct in6_addr *ret) {
assert(link);
assert(ret);
@@ -197,7 +197,7 @@ int address_compare_func(const Address *a1, const Address *a2) {
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(address_hash_ops, Address, address_hash_func, address_compare_func, address_free);
-bool address_equal(Address *a1, Address *a2) {
+bool address_equal(const Address *a1, const Address *a2) {
if (a1 == a2)
return true;
@@ -467,7 +467,7 @@ static int address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, Link
}
int address_remove(
- Address *address,
+ const Address *address,
Link *link,
link_netlink_message_handler_t callback) {
@@ -512,7 +512,7 @@ int address_remove(
return 0;
}
-static bool link_is_static_address_configured(Link *link, Address *address) {
+static bool link_is_static_address_configured(const Link *link, const Address *address) {
Address *net_address;
assert(link);
@@ -528,7 +528,7 @@ static bool link_is_static_address_configured(Link *link, Address *address) {
return false;
}
-static bool link_address_is_dynamic(Link *link, Address *address) {
+static bool link_address_is_dynamic(const Link *link, const Address *address) {
Route *route;
assert(link);
@@ -757,7 +757,7 @@ static int address_acquire(Link *link, const Address *original, Address **ret) {
static int ipv4_dad_configure(Address *address);
int address_configure(
- Address *address,
+ const Address *address,
Link *link,
link_netlink_message_handler_t callback,
bool update,
@@ -956,7 +956,7 @@ static int address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link)
return 1;
}
-static int static_address_configure(Address *address, Link *link, bool update) {
+static int static_address_configure(const Address *address, Link *link, bool update) {
Address *ret;
int r;
diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h
index dbbfb50fd7..c0552979c5 100644
--- a/src/network/networkd-address.h
+++ b/src/network/networkd-address.h
@@ -50,12 +50,12 @@ int address_new(Address **ret);
Address *address_free(Address *address);
int address_get(Link *link, const Address *in, Address **ret);
bool address_exists(Link *link, int family, const union in_addr_union *in_addr);
-int address_configure(Address *address, Link *link, link_netlink_message_handler_t callback, bool update, Address **ret);
-int address_remove(Address *address, Link *link, link_netlink_message_handler_t callback);
-bool address_equal(Address *a1, Address *a2);
+int address_configure(const Address *address, Link *link, link_netlink_message_handler_t callback, bool update, Address **ret);
+int address_remove(const Address *address, Link *link, link_netlink_message_handler_t callback);
+bool address_equal(const Address *a1, const Address *a2);
bool address_is_ready(const Address *a);
-int generate_ipv6_eui_64_address(Link *link, struct in6_addr *ret);
+int generate_ipv6_eui_64_address(const Link *link, struct in6_addr *ret);
DEFINE_NETWORK_SECTION_FUNCTIONS(Address, address_free);