diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-10 05:52:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-10 06:29:24 +0100 |
commit | ffb37250f968297bf3cc50a87c63a18d54efcbd0 (patch) | |
tree | 2b5671e0aada3294b0b35fd0f63d8df29d68598f /src/tools/config.c | |
parent | uapi: use flag instead of C bitfield for portability (diff) | |
download | wireguard-monolithic-historical-ffb37250f968297bf3cc50a87c63a18d54efcbd0.tar.xz wireguard-monolithic-historical-ffb37250f968297bf3cc50a87c63a18d54efcbd0.zip |
uapi: use sockaddr union instead of sockaddr_storage
Diffstat (limited to '')
-rw-r--r-- | src/tools/config.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/config.c b/src/tools/config.c index f326389..83c7db1 100644 --- a/src/tools/config.c +++ b/src/tools/config.c @@ -119,7 +119,7 @@ static inline bool parse_ip(struct wgipmask *ipmask, const char *value) return true; } -static inline bool parse_endpoint(struct sockaddr_storage *endpoint, const char *value) +static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value) { char *mutable = strdup(value); char *begin, *end; @@ -293,7 +293,7 @@ static bool process_line(struct config_ctx *ctx, const char *line) goto error; } else if (ctx->is_peer_section) { if (key_match("Endpoint")) - ret = parse_endpoint(&peer_from_offset(ctx->buf.dev, ctx->peer_offset)->endpoint, value); + ret = parse_endpoint(&peer_from_offset(ctx->buf.dev, ctx->peer_offset)->endpoint.addr, value); else if (key_match("PublicKey")) ret = parse_key(peer_from_offset(ctx->buf.dev, ctx->peer_offset)->public_key, value); else if (key_match("AllowedIPs")) @@ -500,7 +500,7 @@ bool config_read_cmd(struct wgdevice **device, char *argv[], int argc) argv += 1; argc -= 1; } else if (!strcmp(argv[0], "endpoint") && argc >= 2 && buf.dev->num_peers) { - if (!parse_endpoint(&peer_from_offset(buf.dev, peer_offset)->endpoint, argv[1])) + if (!parse_endpoint(&peer_from_offset(buf.dev, peer_offset)->endpoint.addr, argv[1])) goto error; argv += 2; argc -= 2; |