summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp-client.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-05-11 17:08:00 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-12 16:19:58 +0900
commit041ea9f9bb2f20e6e3479cdd94f4c6d4109b6f0e (patch)
treefcdc4507a5c9d9ee1bd37b2daf0dc2bc5a330ae7 /src/libsystemd-network/sd-dhcp-client.c
parent5c2e5957678462d871c5c2ea5261becec5f8f80f (diff)
downloadsystemd-041ea9f9bb2f20e6e3479cdd94f4c6d4109b6f0e.tar.gz
netlink,network: drop "const" from opaque object parameters in supposed-to-be-public APIs
This drops the "const" specifier from the opaque object parameters to various functions in our API. This effectively reverts #19292 and more. Why drop this? Our public APIs should not leak too much information about how stuff is implemented internally. In our public APIs we shouldn't give too many guarantees we don#t want to necessarily keep. Specifically: in many cases it makes sense that getters actually generate/parse/allocate data on the fly, storing/caching the result internally, to speed things up, do things lazily or to track memory allocations so that they can be freed later. Doing this means we need to change the objects, even though the getters are semantically a read operation. We want to retain the freedom that we can change things around internally. By exposing the objects as "const" we remove a good chunk of that, for little gain. See sd_bus_creds_get_description() for a real example of a getter that implicitly caches and thus modifies the relevant object. This removes the "const" decorators from sd-dhcp and sd-netlink, two APIs that we intend to make public eventually even though they still are not, leaving us the chance to still fix this before it becomes set in stone.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-client.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 11492bca97..a15ff8af33 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -2052,7 +2052,7 @@ int sd_dhcp_client_send_renew(sd_dhcp_client *client) {
return client_initialize_time_events(client);
}
-int sd_dhcp_client_is_running(const sd_dhcp_client *client) {
+int sd_dhcp_client_is_running(sd_dhcp_client *client) {
if (!client)
return 0;