diff --git a/abi_used_symbols b/abi_used_symbols new file mode 100644 --- /dev/null +++ b/abi_used_symbols @@ -0,0 +1,78 @@ +libc.so.6:__errno_location +libc.so.6:__fprintf_chk +libc.so.6:__fxstat +libc.so.6:__getdelim +libc.so.6:__libc_start_main +libc.so.6:__printf_chk +libc.so.6:__snprintf_chk +libc.so.6:__stack_chk_fail +libc.so.6:__vasprintf_chk +libc.so.6:__vfprintf_chk +libc.so.6:__xstat +libc.so.6:bind +libc.so.6:calloc +libc.so.6:close +libc.so.6:closedir +libc.so.6:connect +libc.so.6:exit +libc.so.6:fclose +libc.so.6:fdopen +libc.so.6:feof +libc.so.6:ferror +libc.so.6:fflush +libc.so.6:fileno +libc.so.6:fopen +libc.so.6:fputc +libc.so.6:fputs +libc.so.6:fread +libc.so.6:free +libc.so.6:freeaddrinfo +libc.so.6:ftell +libc.so.6:fwrite +libc.so.6:gai_strerror +libc.so.6:getaddrinfo +libc.so.6:getc +libc.so.6:getentropy +libc.so.6:getenv +libc.so.6:getnameinfo +libc.so.6:getsockname +libc.so.6:inet_ntop +libc.so.6:inet_pton +libc.so.6:isatty +libc.so.6:malloc +libc.so.6:memcmp +libc.so.6:memcpy +libc.so.6:memset +libc.so.6:open +libc.so.6:opendir +libc.so.6:perror +libc.so.6:putchar +libc.so.6:puts +libc.so.6:qsort +libc.so.6:read +libc.so.6:readdir +libc.so.6:realloc +libc.so.6:recvmsg +libc.so.6:sendto +libc.so.6:socket +libc.so.6:stderr +libc.so.6:stdin +libc.so.6:stdout +libc.so.6:strcasecmp +libc.so.6:strchr +libc.so.6:strcmp +libc.so.6:strdup +libc.so.6:strerror +libc.so.6:strlen +libc.so.6:strncasecmp +libc.so.6:strncpy +libc.so.6:strrchr +libc.so.6:strsep +libc.so.6:strtoll +libc.so.6:strtoul +libc.so.6:strtoull +libc.so.6:syscall +libc.so.6:sysconf +libc.so.6:time +libc.so.6:unlink +libc.so.6:usleep diff --git a/files/0001-wg-quick-wait-on-process-substitutions.patch b/files/0001-wg-quick-wait-on-process-substitutions.patch new file mode 100644 --- /dev/null +++ b/files/0001-wg-quick-wait-on-process-substitutions.patch @@ -0,0 +1,419 @@ +From 1d42ae3facb30af9915e87f10c9a123e1351b334 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 3 Aug 2020 10:18:40 +0200 +Subject: [PATCH] wg-quick: wait on process substitutions + +Bash does not propagate error values, which is a bummer, but process +substitutions are a useful feature. Introduce a new idiom to deal with +this: either "; wait $!" after the line to propagate the error, or "|| +true" to indicate explicitly that we don't care about the error. + +Signed-off-by: Jason A. Donenfeld +--- + src/wg-quick/darwin.bash | 28 ++++++++++++++-------------- + src/wg-quick/freebsd.bash | 24 ++++++++++++------------ + src/wg-quick/linux.bash | 22 +++++++++++----------- + src/wg-quick/openbsd.bash | 22 +++++++++++----------- + 4 files changed, 48 insertions(+), 48 deletions(-) + +diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash +index cde1b54..26c6cd3 100755 +--- a/src/wg-quick/darwin.bash ++++ b/src/wg-quick/darwin.bash +@@ -92,7 +92,7 @@ detect_launchd() { + LAUNCHED_BY_LAUNCHD=1 + break + fi +- done < <(launchctl procinfo $$ 2>/dev/null) ++ done < <(launchctl procinfo $$ 2>/dev/null); wait $! + } + + read_bool() { +@@ -132,14 +132,14 @@ del_routes() { + local todelete=( ) destination gateway netif + while read -r destination _ _ _ _ netif _; do + [[ $netif == "$REAL_INTERFACE" ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet "$destination" >/dev/null || true + done + todelete=( ) + while read -r destination gateway _ netif; do + [[ $netif == "$REAL_INTERFACE" || ( $netif == lo* && $gateway == "$REAL_INTERFACE" ) ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet6 "$destination" >/dev/null || true + done +@@ -181,7 +181,7 @@ set_mtu() { + defaultif="$netif" + break + fi +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + [[ -n $defaultif && $(ifconfig "$defaultif") =~ mtu\ ([0-9]+) ]] && mtu="${BASH_REMATCH[1]}" + [[ $mtu -gt 0 ]] || mtu=1500 + mtu=$(( mtu - 80 )) +@@ -197,14 +197,14 @@ collect_gateways() { + [[ $destination == default ]] || continue + GATEWAY4="$gateway" + break +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + + GATEWAY6="" + while read -r destination gateway _; do + [[ $destination == default ]] || continue + GATEWAY6="$gateway" + break +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + } + + collect_endpoints() { +@@ -212,7 +212,7 @@ collect_endpoints() { + while read -r _ endpoint; do + [[ $endpoint =~ ^\[?([a-z0-9:.]+)\]?:[0-9]+$ ]] || continue + ENDPOINTS+=( "${BASH_REMATCH[1]}" ) +- done < <(wg show "$REAL_INTERFACE" endpoints) ++ done < <(wg show "$REAL_INTERFACE" endpoints); wait $! + } + + declare -A SERVICE_DNS +@@ -230,7 +230,7 @@ collect_new_service_dns() { + get_response="$(cmd networksetup -getsearchdomains "$service")" + [[ $get_response == *" "* ]] && get_response="Empty" + [[ -n $get_response ]] && SERVICE_DNS_SEARCH["$service"]="$get_response" +- done; } < <(networksetup -listallnetworkservices) ++ done; } < <(networksetup -listallnetworkservices); wait $! + + for service in "${!SERVICE_DNS[@]}"; do + if ! [[ -n ${found_services["$service"]} ]]; then +@@ -304,7 +304,7 @@ set_dns() { + else + cmd networksetup -setsearchdomains "$service" "${DNS_SEARCH[@]}" + fi +- ) ++ ); wait $! + done + } + +@@ -316,7 +316,7 @@ del_dns() { + done < <( + cmd networksetup -setdnsservers "$service" ${SERVICE_DNS["$service"]} || true + cmd networksetup -setsearchdomains "$service" ${SERVICE_DNS_SEARCH["$service"]} || true +- ) ++ ); wait $! + done + } + +@@ -339,7 +339,7 @@ monitor_daemon() { + set_dns + sleep 2 && kill -ALRM $pid 2>/dev/null & + fi +- done < <(route -n monitor)) & ++ done < <(route -n monitor); wait $!) & + [[ -n $LAUNCHED_BY_LAUNCHD ]] || disown + } + +@@ -367,7 +367,7 @@ add_route() { + } + + set_config() { +- cmd wg setconf "$REAL_INTERFACE" <(echo "$WG_CONFIG") ++ cmd wg setconf "$REAL_INTERFACE" <(echo "$WG_CONFIG"); wait $! + } + + save_config() { +@@ -375,7 +375,7 @@ save_config() { + new_config=$'[Interface]\n' + while read -r address; do + [[ $address =~ inet6?\ ([^ ]+) ]] && new_config+="Address = ${BASH_REMATCH[1]}"$'\n' +- done < <(ifconfig "$REAL_INTERFACE") ++ done < <(ifconfig "$REAL_INTERFACE"); wait $! + # TODO: actually determine current DNS for interface + for address in "${DNS[@]}"; do + new_config+="DNS = $address"$'\n' +@@ -458,7 +458,7 @@ cmd_up() { + done + set_mtu + up_if +- for i in $(while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$REAL_INTERFACE" allowed-ips) | sort -nr -k 2 -t /); do ++ for i in $({ while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$REAL_INTERFACE" allowed-ips); wait $!; } | sort -nr -k 2 -t /); do + add_route "$i" + done + [[ $AUTO_ROUTE4 -eq 1 || $AUTO_ROUTE6 -eq 1 ]] && set_endpoint_direct_route +diff --git a/src/wg-quick/freebsd.bash b/src/wg-quick/freebsd.bash +index 88aa2b4..b15cb8a 100755 +--- a/src/wg-quick/freebsd.bash ++++ b/src/wg-quick/freebsd.bash +@@ -132,14 +132,14 @@ del_routes() { + local todelete=( ) destination gateway netif + while read -r destination _ _ _ _ netif _; do + [[ $netif == "$INTERFACE" ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet "$destination" || true + done + todelete=( ) + while read -r destination gateway _ netif; do + [[ $netif == "$INTERFACE" || ( $netif == lo* && $gateway == "$INTERFACE" ) ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet6 "$destination" || true + done +@@ -206,9 +206,9 @@ set_mtu() { + [[ ${BASH_REMATCH[1]} == *:* ]] && family=inet6 + output="$(route -n get "-$family" "${BASH_REMATCH[1]}" || true)" + [[ $output =~ interface:\ ([^ ]+)$'\n' && $(ifconfig "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" +- done < <(wg show "$INTERFACE" endpoints) ++ done < <(wg show "$INTERFACE" endpoints); wait $! + if [[ $mtu -eq 0 ]]; then +- read -r output < <(route -n get default || true) || true ++ read -r output < <(route -n get default) || true + [[ $output =~ interface:\ ([^ ]+)$'\n' && $(ifconfig "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" + fi + [[ $mtu -gt 0 ]] || mtu=1500 +@@ -224,14 +224,14 @@ collect_gateways() { + [[ $destination == default ]] || continue + GATEWAY4="$gateway" + break +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + + GATEWAY6="" + while read -r destination gateway _; do + [[ $destination == default ]] || continue + GATEWAY6="$gateway" + break +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + } + + collect_endpoints() { +@@ -239,7 +239,7 @@ collect_endpoints() { + while read -r _ endpoint; do + [[ $endpoint =~ ^\[?([a-z0-9:.]+)\]?:[0-9]+$ ]] || continue + ENDPOINTS+=( "${BASH_REMATCH[1]}" ) +- done < <(wg show "$INTERFACE" endpoints) ++ done < <(wg show "$INTERFACE" endpoints); wait $! + } + + set_endpoint_direct_route() { +@@ -308,7 +308,7 @@ monitor_daemon() { + if_exists || break + [[ $AUTO_ROUTE4 -eq 1 || $AUTO_ROUTE6 -eq 1 ]] && set_endpoint_direct_route + # TODO: set the mtu as well, but only if up +- done < <(route -n monitor)) & disown ++ done < <(route -n monitor); wait $!) & disown + } + + HAVE_SET_DNS=0 +@@ -357,13 +357,13 @@ save_config() { + new_config=$'[Interface]\n' + { read -r _; while read -r _ _ _ address _; do + new_config+="Address = $address"$'\n' +- done } < <(netstat -I "$INTERFACE" -n -W -f inet) ++ done } < <(netstat -I "$INTERFACE" -n -W -f inet); wait $! + { read -r _; while read -r _ _ _ address _; do + new_config+="Address = $address"$'\n' +- done } < <(netstat -I "$INTERFACE" -n -W -f inet6) ++ done } < <(netstat -I "$INTERFACE" -n -W -f inet6); wait $! + while read -r address; do + [[ $address =~ ^nameserver\ ([a-zA-Z0-9_=+:%.-]+)$ ]] && new_config+="DNS = ${BASH_REMATCH[1]}"$'\n' +- done < <(resolvconf -l "$INTERFACE" 2>/dev/null) ++ done < <(resolvconf -l "$INTERFACE" 2>/dev/null); wait $! + [[ -n $MTU ]] && new_config+="MTU = $MTU"$'\n' + [[ -n $TABLE ]] && new_config+="Table = $TABLE"$'\n' + [[ $SAVE_CONFIG -eq 0 ]] || new_config+=$'SaveConfig = true\n' +@@ -441,7 +441,7 @@ cmd_up() { + set_mtu + up_if + set_dns +- for i in $(while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$INTERFACE" allowed-ips) | sort -nr -k 2 -t /); do ++ for i in $({ while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$INTERFACE" allowed-ips); wait $!; } | sort -nr -k 2 -t /); do + add_route "$i" + done + [[ $AUTO_ROUTE4 -eq 1 || $AUTO_ROUTE6 -eq 1 ]] && set_endpoint_direct_route +diff --git a/src/wg-quick/linux.bash b/src/wg-quick/linux.bash +index e4d4c4f..8bda740 100755 +--- a/src/wg-quick/linux.bash ++++ b/src/wg-quick/linux.bash +@@ -132,9 +132,9 @@ set_mtu_up() { + [[ $endpoint =~ ^\[?([a-z0-9:.]+)\]?:[0-9]+$ ]] || continue + output="$(ip route get "${BASH_REMATCH[1]}" || true)" + [[ ( $output =~ mtu\ ([0-9]+) || ( $output =~ dev\ ([^ ]+) && $(ip link show dev "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) ) ) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" +- done < <(wg show "$INTERFACE" endpoints) ++ done < <(wg show "$INTERFACE" endpoints); wait $! + if [[ $mtu -eq 0 ]]; then +- read -r output < <(ip route show default || true) || true ++ read -r output < <(ip route show default) || true + [[ ( $output =~ mtu\ ([0-9]+) || ( $output =~ dev\ ([^ ]+) && $(ip link show dev "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) ) ) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" + fi + [[ $mtu -gt 0 ]] || mtu=1500 +@@ -191,8 +191,8 @@ remove_firewall() { + local table nftcmd + while read -r table; do + [[ $table == *" wg-quick-$INTERFACE" ]] && printf -v nftcmd '%sdelete %s\n' "$nftcmd" "$table" +- done < <(nft list tables 2>/dev/null) +- [[ -z $nftcmd ]] || cmd nft -f <(echo -n "$nftcmd") ++ done < <(nft list tables 2>/dev/null) || true ++ [[ -z $nftcmd ]] || cmd nft -f <(echo -n "$nftcmd"); wait $! + fi + if type -p iptables >/dev/null; then + local line iptables found restore +@@ -202,7 +202,7 @@ remove_firewall() { + [[ $line == "*"* || $line == COMMIT || $line == "-A "*"-m comment --comment \"wg-quick(8) rule for $INTERFACE\""* ]] || continue + [[ $line == "-A"* ]] && found=1 + printf -v restore '%s%s\n' "$restore" "${line/#-A/-D}" +- done < <($iptables-save 2>/dev/null) ++ done < <($iptables-save 2>/dev/null) || true + [[ $found -ne 1 ]] || echo -n "$restore" | cmd $iptables-restore -n + done + fi +@@ -233,22 +233,22 @@ add_default() { + [[ $line =~ .*inet6?\ ([0-9a-f:.]+)/[0-9]+.* ]] || continue + printf -v restore '%s-I PREROUTING ! -i %s -d %s -m addrtype ! --src-type LOCAL -j DROP %s\n' "$restore" "$INTERFACE" "${BASH_REMATCH[1]}" "$marker" + printf -v nftcmd '%sadd rule %s %s preraw iifname != "%s" %s daddr %s fib saddr type != local drop\n' "$nftcmd" "$pf" "$nftable" "$INTERFACE" "$pf" "${BASH_REMATCH[1]}" +- done < <(ip -o $proto addr show dev "$INTERFACE" 2>/dev/null) ++ done < <(ip -o $proto addr show dev "$INTERFACE"); wait $! + printf -v restore '%sCOMMIT\n*mangle\n-I POSTROUTING -m mark --mark %d -p udp -j CONNMARK --save-mark %s\n-I PREROUTING -p udp -j CONNMARK --restore-mark %s\nCOMMIT\n' "$restore" $table "$marker" "$marker" + printf -v nftcmd '%sadd rule %s %s postmangle meta l4proto udp mark %d ct mark set mark \n' "$nftcmd" "$pf" "$nftable" $table + printf -v nftcmd '%sadd rule %s %s premangle meta l4proto udp meta mark set ct mark \n' "$nftcmd" "$pf" "$nftable" + [[ $proto == -4 ]] && cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1 + if type -p nft >/dev/null; then +- cmd nft -f <(echo -n "$nftcmd") ++ cmd nft -f <(echo -n "$nftcmd"); wait $! + else +- echo -n "$restore" | cmd $iptables-restore -n ++ echo -n "$restore" | cmd $iptables-restore -n; wait $! + fi + HAVE_SET_FIREWALL=1 + return 0 + } + + set_config() { +- cmd wg setconf "$INTERFACE" <(echo "$WG_CONFIG") ++ cmd wg setconf "$INTERFACE" <(echo "$WG_CONFIG"); wait $! + } + + save_config() { +@@ -260,7 +260,7 @@ save_config() { + done + while read -r address; do + [[ $address =~ ^nameserver\ ([a-zA-Z0-9_=+:%.-]+)$ ]] && new_config+="DNS = ${BASH_REMATCH[1]}"$'\n' +- done < <(resolvconf -l "$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null || cat "/etc/resolvconf/run/interface/$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null) ++ done < <(resolvconf -l "$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null || cat "/etc/resolvconf/run/interface/$(resolvconf_iface_prefix)$INTERFACE" 2>/dev/null) || true + [[ -n $MTU && $(ip link show dev "$INTERFACE") =~ mtu\ ([0-9]+) ]] && new_config+="MTU = ${BASH_REMATCH[1]}"$'\n' + [[ -n $TABLE ]] && new_config+="Table = $TABLE"$'\n' + [[ $SAVE_CONFIG -eq 0 ]] || new_config+=$'SaveConfig = true\n' +@@ -335,7 +335,7 @@ cmd_up() { + done + set_mtu_up + set_dns +- for i in $(while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$INTERFACE" allowed-ips) | sort -nr -k 2 -t /); do ++ for i in $({ while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$INTERFACE" allowed-ips); wait $!; } | sort -nr -k 2 -t /); do + add_route "$i" + done + execute_hooks "${POST_UP[@]}" +diff --git a/src/wg-quick/openbsd.bash b/src/wg-quick/openbsd.bash +index 15550c8..7b8d4e1 100755 +--- a/src/wg-quick/openbsd.bash ++++ b/src/wg-quick/openbsd.bash +@@ -122,14 +122,14 @@ del_routes() { + [[ -n $REAL_INTERFACE ]] || return 0 + while read -r destination _ _ _ _ netif _; do + [[ $netif == "$REAL_INTERFACE" ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet "$destination" || true + done + todelete=( ) + while read -r destination gateway _ netif; do + [[ $netif == "$REAL_INTERFACE" || ( $netif == lo* && $gateway == "$REAL_INTERFACE" ) ]] && todelete+=( "$destination" ) +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + for destination in "${todelete[@]}"; do + cmd route -q -n delete -inet6 "$destination" || true + done +@@ -175,9 +175,9 @@ set_mtu() { + [[ ${BASH_REMATCH[1]} == *:* ]] && family=inet6 + output="$(route -n get "-$family" "${BASH_REMATCH[1]}" || true)" + [[ $output =~ interface:\ ([^ ]+)$'\n' && $(ifconfig "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" +- done < <(wg show "$REAL_INTERFACE" endpoints) ++ done < <(wg show "$REAL_INTERFACE" endpoints); wait $! + if [[ $mtu -eq 0 ]]; then +- read -r output < <(route -n get default || true) || true ++ read -r output < <(route -n get default) || true + [[ $output =~ interface:\ ([^ ]+)$'\n' && $(ifconfig "${BASH_REMATCH[1]}") =~ mtu\ ([0-9]+) && ${BASH_REMATCH[1]} -gt $mtu ]] && mtu="${BASH_REMATCH[1]}" + fi + [[ $mtu -gt 0 ]] || mtu=1500 +@@ -193,14 +193,14 @@ collect_gateways() { + [[ $destination == default ]] || continue + GATEWAY4="$gateway" + break +- done < <(netstat -nr -f inet) ++ done < <(netstat -nr -f inet); wait $! + + GATEWAY6="" + while read -r destination gateway _; do + [[ $destination == default ]] || continue + GATEWAY6="$gateway" + break +- done < <(netstat -nr -f inet6) ++ done < <(netstat -nr -f inet6); wait $! + } + + collect_endpoints() { +@@ -208,7 +208,7 @@ collect_endpoints() { + while read -r _ endpoint; do + [[ $endpoint =~ ^\[?([a-z0-9:.]+)\]?:[0-9]+$ ]] || continue + ENDPOINTS+=( "${BASH_REMATCH[1]}" ) +- done < <(wg show "$REAL_INTERFACE" endpoints) ++ done < <(wg show "$REAL_INTERFACE" endpoints); wait $! + } + + set_endpoint_direct_route() { +@@ -276,7 +276,7 @@ monitor_daemon() { + ifconfig "$REAL_INTERFACE" >/dev/null 2>&1 || break + [[ $AUTO_ROUTE4 -eq 1 || $AUTO_ROUTE6 -eq 1 ]] && set_endpoint_direct_route + # TODO: set the mtu as well, but only if up +- done < <(route -n monitor)) & disown ++ done < <(route -n monitor); wait $!) & disown + } + + set_dns() { +@@ -325,7 +325,7 @@ add_route() { + } + + set_config() { +- cmd wg setconf "$REAL_INTERFACE" <(echo "$WG_CONFIG") ++ cmd wg setconf "$REAL_INTERFACE" <(echo "$WG_CONFIG"); wait $! + } + + save_config() { +@@ -333,7 +333,7 @@ save_config() { + new_config=$'[Interface]\n' + { read -r _; while read -r _ _ network address _; do + [[ $network == *Link* ]] || new_config+="Address = $address"$'\n' +- done } < <(netstat -I "$REAL_INTERFACE" -n -v) ++ done } < <(netstat -I "$REAL_INTERFACE" -n -v); wait $! + # TODO: actually determine current DNS for interface + for address in "${DNS[@]}"; do + new_config+="DNS = $address"$'\n' +@@ -414,7 +414,7 @@ cmd_up() { + set_mtu + up_if + set_dns +- for i in $(while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$REAL_INTERFACE" allowed-ips) | sort -nr -k 2 -t /); do ++ for i in $({ while read -r _ i; do for i in $i; do [[ $i =~ ^[0-9a-z:.]+/[0-9]+$ ]] && echo "$i"; done; done < <(wg show "$REAL_INTERFACE" allowed-ips); wait $!; } | sort -nr -k 2 -t /); do + add_route "$i" + done + [[ $AUTO_ROUTE4 -eq 1 || $AUTO_ROUTE6 -eq 1 ]] && set_endpoint_direct_route +-- +2.30.2 + diff --git a/files/series b/files/series new file mode 100644 --- /dev/null +++ b/files/series @@ -0,0 +1 @@ +0001-wg-quick-wait-on-process-substitutions.patch diff --git a/package.yml b/package.yml --- a/package.yml +++ b/package.yml @@ -1,8 +1,8 @@ name : wireguard-tools -version : 1.0.20200820 -release : 3 +version : 1.0.20210315 +release : 5 source : - - https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-1.0.20200820.tar.xz : 7735a04c68fffb101a10a67e3bd97a171f2b8eb47e9ddce2be68eb6538b013d0 + - https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-1.0.20210315.tar.xz : af001d5492be6bf58ef0bebe04b446b6f50eb53e1226fab679cc34af40733a22 license : GPL-2.0-only component : network.util summary : Required tools for WireGuard, such as wg(8) and wg-quick(8) @@ -13,6 +13,8 @@ environment: | export WITH_WGQUICK=yes export WITH_SYSTEMDUNITS=yes +setup : | + %apply_patches build : | %make -C src install : | diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml --- a/pspec_x86_64.xml +++ b/pspec_x86_64.xml @@ -30,12 +30,12 @@ - - 2020-08-22 - 1.0.20200820 + + 2021-03-17 + 1.0.20210315 Packaging update Silke Hofstra silke@slxh.eu \ No newline at end of file