Skip to content

Commit

Permalink
New package: passt-2023.02.27.c538ee8
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmi committed Mar 2, 2023
1 parent fc66ccd commit dd53067
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
96 changes: 96 additions & 0 deletions srcpkgs/passt/patches/musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
diff --git a/conf.c b/conf.c
index 0e512f4..3e38948 100644
--- a/conf.c
+++ b/conf.c
@@ -1305,13 +1305,13 @@ void conf(struct ctx *c, int argc, char **argv)
if (logfile)
die("Can't log to both file and stderr");

- if (c->stderr)
+ if (c->_stderr)
die("Multiple --stderr options given");

- c->stderr = 1;
+ c->_stderr = 1;
break;
case 'l':
- if (c->stderr)
+ if (c->_stderr)
die("Can't log to both stderr and file");

if (logfile)
diff --git a/passt.c b/passt.c
index 5b8146e..6d6dfcb 100644
--- a/passt.c
+++ b/passt.c
@@ -241,7 +241,7 @@ int main(int argc, char **argv)
conf(&c, argc, argv);
trace_init(c.trace);

- if (c.stderr || isatty(fileno(stdout)))
+ if (c._stderr || isatty(fileno(stdout)))
__openlog(log_name, LOG_PERROR, LOG_DAEMON);

quit_fd = pasta_netns_quit_init(&c);
diff --git a/passt.h b/passt.h
index e0383eb..697b8f0 100644
--- a/passt.h
+++ b/passt.h
@@ -32,7 +32,7 @@ struct tap_l4_msg {
union epoll_ref;

#include <stdbool.h>
-
+#include <limits.h>
#include "packet.h"
#include "icmp.h"
#include "port_fwd.h"
@@ -197,7 +197,7 @@ struct ctx {
int trace;
int quiet;
int foreground;
- int stderr;
+ int _stderr;
int nofile;
char sock_path[UNIX_PATH_MAX];
char pcap[PATH_MAX];
diff --git a/util.h b/util.h
index 570094c..7315ce2 100644
--- a/util.h
+++ b/util.h
@@ -7,7 +7,10 @@
#define UTIL_H

#include <stdlib.h>
+#include <stdio.h>
#include <stdarg.h>
+#include <signal.h>
+#include <byteswap.h>

#include "log.h"

@@ -88,6 +91,8 @@
#define MAC_ZERO ((uint8_t [ETH_ALEN]){ 0 })
#define MAC_IS_ZERO(addr) (!memcmp((addr), MAC_ZERO, ETH_ALEN))

+#if defined(__GLIBC__) || defined(__UCLIBC__)
+
#if __BYTE_ORDER == __BIG_ENDIAN
#define htons_constant(x) (x)
#define htonl_constant(x) (x)
@@ -96,6 +101,15 @@
#define htonl_constant(x) (__bswap_constant_32(x))
#endif

+#else
+
+/* mainly musl fallback */
+
+#define htons_constant(x) (x)
+#define htonl_constant(x) (x)
+
+#endif
+
#define IN4_IS_ADDR_UNSPECIFIED(a) \
((a)->s_addr == htonl(INADDR_ANY))
#define IN4_IS_ADDR_BROADCAST(a) \
21 changes: 21 additions & 0 deletions srcpkgs/passt/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Template file for 'passt'
pkgname=passt
version=2023.02.27.c538ee8
revision=1
# upstream uses YYYY_MM_DD.COMMIT
_version=${version/./_}
_version=${_version/./_}
# https://bugs.passt.top/show_bug.cgi?id=4
#archs="~*-musl"
build_style=gnu-makefile
short_desc="Plug A Simple Socket Transport"
maintainer="lemmi <[email protected]>"
license="AGPL-3.0-or-later, BSD-3-Clause"
homepage="https://passt.top"
distfiles="https://passt.top/passt/snapshot/passt-${_version}.tar.xz"
checksum=e09399ca10d1ddfb372580ac7e2540d00e417e1621d917b5f8ee1cd6adbd6772

post_install() {
vlicense LICENSES/AGPL-3.0-or-later.txt
vlicense LICENSES/BSD-3-Clause.txt
}
2 changes: 2 additions & 0 deletions srcpkgs/passt/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site="https://passt.top/passt"
pattern='passt-\K[\d._abcdef]+(?=.tar.xz)'

0 comments on commit dd53067

Please sign in to comment.