diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-07 11:13:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-06-07 11:13:39 +0200 |
commit | a849538e3bf0097595fc1fd86bcda608d1151b4c (patch) | |
tree | 20e5dbc1399719e7e24ac6997adf2428a8cdce51 /src/libsystemd-network/network-internal.c | |
parent | 82e4eda664d40ef60829e27d84b1610c2f4070cd (diff) | |
parent | 1e7a0e21c97ac1bbc743009e5ec8c12bc6200e19 (diff) |
Merge pull request #3394 from poettering/triple-tstamp
timestamping improvements and IPv6 RA revamp
Diffstat (limited to 'src/libsystemd-network/network-internal.c')
-rw-r--r-- | src/libsystemd-network/network-internal.c | 15 |
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) { |