summaryrefslogtreecommitdiff
path: root/sys-apps/systemd/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
commit2018227e9344edb9da15fc6a4a8298086cc2aa77 (patch)
treec18e1c09e605e94e2a1e93345ad25746cc9e14b9 /sys-apps/systemd/files
parent6f8038813c460b4f0572d5ef595cdfa94af3a94d (diff)
gentoo resync : 02.06.2019
Diffstat (limited to 'sys-apps/systemd/files')
-rw-r--r--sys-apps/systemd/files/242-wireguard-listenport.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/sys-apps/systemd/files/242-wireguard-listenport.patch b/sys-apps/systemd/files/242-wireguard-listenport.patch
new file mode 100644
index 000000000000..39b3c7c0a54c
--- /dev/null
+++ b/sys-apps/systemd/files/242-wireguard-listenport.patch
@@ -0,0 +1,49 @@
+From a62b7bb79e9a2aa683624c32cde1c756d8466fb4 Mon Sep 17 00:00:00 2001
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Thu, 25 Apr 2019 00:39:04 +0200
+Subject: [PATCH] network: fix ListenPort= in [WireGuard] section
+
+This fixes a bug introduced by f1368a333e5e08575f0b45dfe41e936b106a8627.
+
+Fixes #12377.
+---
+ src/network/netdev/wireguard.c | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
+index f3084c0773f..5ebc5dfed84 100644
+--- a/src/network/netdev/wireguard.c
++++ b/src/network/netdev/wireguard.c
+@@ -452,22 +452,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;
+ }
+