summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/network-internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-network/network-internal.c')
-rw-r--r--src/libsystemd-network/network-internal.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c
index bfaa75880b..ce30b7fc25 100644
--- a/src/libsystemd-network/network-internal.c
+++ b/src/libsystemd-network/network-internal.c
@@ -380,18 +380,21 @@ int deserialize_in_addrs(struct in_addr **ret, const char *string) {
return size;
}
-void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
- size_t size) {
+void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, size_t size) {
unsigned i;
assert(f);
assert(addresses);
assert(size);
- for (i = 0; i < size; i++)
- fprintf(f, SD_NDISC_ADDRESS_FORMAT_STR"%s",
- SD_NDISC_ADDRESS_FORMAT_VAL(addresses[i]),
- (i < (size - 1)) ? " ": "");
+ for (i = 0; i < size; i++) {
+ char buffer[INET6_ADDRSTRLEN];
+
+ fputs(inet_ntop(AF_INET6, addresses+i, buffer, sizeof(buffer)), f);
+
+ if (i < size - 1)
+ fputc(' ', f);
+ }
}
int deserialize_in6_addrs(struct in6_addr **ret, const char *string) {