mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:37:34 +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:
parent
60ace37713
commit
d099527dbb
3 changed files with 37 additions and 0 deletions
8
Ports/wireguard-tools/package.sh
Executable file
8
Ports/wireguard-tools/package.sh
Executable 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")
|
|
@ -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) {
|
Loading…
Add table
Add a link
Reference in a new issue