1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

Ports: Add wireguard-tools

What will it take to port WireGuard to SerenityOS? No idea. But this is
a start :^)
This commit is contained in:
Linus Groh 2022-01-10 19:53:40 +01:00
parent 60ace37713
commit d099527dbb
3 changed files with 37 additions and 0 deletions

View file

@ -188,6 +188,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`vitetris`](vitetris/) | vitetris | 0.59.1 | https://github.com/vicgeralds/vitetris |
| [`vttest`](vttest/) | vttest | 20210210 | https://invisible-island.net/vttest/ |
| [`wget`](wget/) | GNU Wget | 1.21.1 | https://www.gnu.org/software/wget/ |
| [`wireguard-tools`](wireguard-tools/) | WireGuard Tools | 1.0.20210914 | https://www.wireguard.com/ |
| [`xz`](xz/) | xz | 5.2.5 | https://tukaani.org/xz/ |
| [`yasm`](yasm/) | Yasm Modular Assembler | 1.3.0 | https://yasm.tortall.net/ |
| [`zlib`](zlib/) | zlib | 1.2.11 | https://www.zlib.net/ |

View file

@ -0,0 +1,8 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=wireguard-tools
version=1.0.20210914
files="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${version}.tar.xz wireguard-tools-${version}.tar.xz 97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac"
auth_type=sha256
makeopts=("--directory=src")
# NOTE: PREFIX extends DESTDIR and therefore must not include $SERENITY_INSTALL_ROOT!
installopts=("--directory=src" "PREFIX=/usr/local")

View file

@ -0,0 +1,28 @@
--- wireguard-tools-1.0.20210914/src/ipc-uapi.h 2022-01-10 19:32:48.333858269 +0100
+++ wireguard-tools-1.0.20210914/src/ipc-uapi.h 2022-01-10 19:34:25.996423462 +0100
@@ -246,7 +246,7 @@
peer->flags |= WGPEER_HAS_PERSISTENT_KEEPALIVE_INTERVAL;
} else if (peer && !strcmp(key, "allowed_ip")) {
struct wgallowedip *new_allowedip;
- char *end, *mask = value, *ip = strsep(&mask, "/");
+ char *end, *mask = value, *ip = strtok(mask, "/");
if (!mask || !char_is_digit(mask[0]))
break;
--- wireguard-tools-1.0.20210914/src/config.c 2022-01-10 19:35:02.057260483 +0100
+++ wireguard-tools-1.0.20210914/src/config.c 2022-01-10 19:35:23.359164203 +0100
@@ -352,12 +352,12 @@
return true;
}
sep = mutable;
- while ((mask = strsep(&sep, ","))) {
+ while ((mask = strtok(sep, ","))) {
unsigned long cidr;
char *end, *ip;
saved_entry = strdup(mask);
- ip = strsep(&mask, "/");
+ ip = strtok(mask, "/");
new_allowedip = calloc(1, sizeof(*new_allowedip));
if (!new_allowedip) {