Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

Commit

Permalink
network: fix ListenPort= in [WireGuard] section
Browse files Browse the repository at this point in the history
This fixes a bug introduced by f1368a3.

Fixes systemd#12377.

(cherry picked from commit a62b7bb)
  • Loading branch information
yuwata authored and keszybz committed Apr 26, 2019
1 parent 0f5caf8 commit db466d8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/network/netdev/wireguard.c
Expand Up @@ -453,22 +453,23 @@ int config_parse_wireguard_listen_port(
void *userdata) {

uint16_t *s = data;
uint16_t port = 0;
int r;

assert(rvalue);
assert(data);

if (!streq(rvalue, "auto")) {
r = parse_ip_port(rvalue, s);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r,
"Invalid port specification, ignoring assignment: %s", rvalue);
return 0;
}
if (isempty(rvalue) || streq(rvalue, "auto")) {
*s = 0;
return 0;
}

r = parse_ip_port(rvalue, s);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r,
"Invalid port specification, ignoring assignment: %s", rvalue);
return 0;
}

*s = port;
return 0;
}

Expand Down

0 comments on commit db466d8

Please sign in to comment.