diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index d02a2a9279a..f704445654e 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -225,7 +225,7 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda if (r < 0) { switch (r) { case -EADDRNOTAVAIL: - (void) in_addr_to_string(AF_INET6, (union in_addr_union*) &rt->address, &addr); + (void) in_addr_to_string(AF_INET6, (const union in_addr_union*) &rt->address, &addr); log_ndisc("Received RA from non-link-local address %s. Ignoring", addr); break; diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index eac9b159ce0..164b24c6847 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -244,7 +244,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat if (r < 0) { switch (r) { case -EADDRNOTAVAIL: - (void) in_addr_to_string(AF_INET6, (union in_addr_union*) &src, &addr); + (void) in_addr_to_string(AF_INET6, (const union in_addr_union*) &src, &addr); log_radv("Received RS from non-link-local address %s. Ignoring", addr); break; @@ -272,7 +272,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat return 0; } - (void) in_addr_to_string(AF_INET6, (union in_addr_union*) &src, &addr); + (void) in_addr_to_string(AF_INET6, (const union in_addr_union*) &src, &addr); r = radv_send(ra, &src, ra->lifetime); if (r < 0) @@ -540,15 +540,15 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) { return -ENOEXEC; (void) in_addr_prefix_to_string(AF_INET6, - (union in_addr_union*) &p->opt.in6_addr, + (const union in_addr_union*) &p->opt.in6_addr, p->opt.prefixlen, &addr_p); LIST_FOREACH(prefix, cur, ra->prefixes) { r = in_addr_prefix_intersect(AF_INET6, - (union in_addr_union*) &cur->opt.in6_addr, + (const union in_addr_union*) &cur->opt.in6_addr, cur->opt.prefixlen, - (union in_addr_union*) &p->opt.in6_addr, + (const union in_addr_union*) &p->opt.in6_addr, p->opt.prefixlen); if (r < 0) return r; @@ -560,7 +560,7 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) { _cleanup_free_ char *addr_cur = NULL; (void) in_addr_prefix_to_string(AF_INET6, - (union in_addr_union*) &cur->opt.in6_addr, + (const union in_addr_union*) &cur->opt.in6_addr, cur->opt.prefixlen, &addr_cur); log_radv("IPv6 prefix %s already configured, ignoring %s", strna(addr_cur), strna(addr_p)); @@ -656,15 +656,15 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int return -EINVAL; (void) in_addr_prefix_to_string(AF_INET6, - (union in_addr_union*) &p->opt.in6_addr, + (const union in_addr_union*) &p->opt.in6_addr, p->opt.prefixlen, &pretty); LIST_FOREACH(prefix, cur, ra->route_prefixes) { r = in_addr_prefix_intersect(AF_INET6, - (union in_addr_union*) &cur->opt.in6_addr, + (const union in_addr_union*) &cur->opt.in6_addr, cur->opt.prefixlen, - (union in_addr_union*) &p->opt.in6_addr, + (const union in_addr_union*) &p->opt.in6_addr, p->opt.prefixlen); if (r < 0) return r; @@ -676,7 +676,7 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int _cleanup_free_ char *addr = NULL; (void) in_addr_prefix_to_string(AF_INET6, - (union in_addr_union*) &cur->opt.in6_addr, + (const union in_addr_union*) &cur->opt.in6_addr, cur->opt.prefixlen, &addr); log_radv("IPv6 route prefix %s already configured, ignoring %s", strna(addr), strna(pretty)); diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index d9776940a41..7af8e620a08 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -150,7 +150,7 @@ static int ndisc_remove_old_one(Link *link, const struct in6_addr *router, bool if (DEBUG_LOGGING) { _cleanup_free_ char *buf = NULL; - (void) in_addr_to_string(AF_INET6, (union in_addr_union *) router, &buf); + (void) in_addr_to_string(AF_INET6, (const union in_addr_union*) router, &buf); log_link_debug(link, "No SLAAC address obtained from %s is ready. " "The old NDisc information will be removed later.", strna(buf)); @@ -162,7 +162,7 @@ static int ndisc_remove_old_one(Link *link, const struct in6_addr *router, bool if (DEBUG_LOGGING) { _cleanup_free_ char *buf = NULL; - (void) in_addr_to_string(AF_INET6, (union in_addr_union *) router, &buf); + (void) in_addr_to_string(AF_INET6, (const union in_addr_union*) router, &buf); log_link_debug(link, "Removing old NDisc information obtained from %s.", strna(buf)); } diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 6f3b3566d73..6410a419447 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -1474,7 +1474,7 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m if (prefixlen > FAMILY_ADDRESS_SIZE(family) * 8) continue; - if (in_addr_prefix_to_string(family, (union in_addr_union *) ap, prefixlen, &str) < 0) + if (in_addr_prefix_to_string(family, (const union in_addr_union*) ap, prefixlen, &str) < 0) continue; if (!strextend_with_separator(&addresses, " ", str))