Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion net/sslh/distinfo
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ SHA1 (sslh-1.18.tar.gz) = dacf6250e26250513deeaa310c78591d5b3e77f4
RMD160 (sslh-1.18.tar.gz) = 49e83f975f7e8df8358bdd1d7afeabdbe6269a82
SHA512 (sslh-1.18.tar.gz) = 859ad65a258534fde68295a2880c077a00205d96a6aafeb525abce836850b9deea7b39daa2dc74a0dc18d2b198884958a39fbe758d61c93b257676f3a7d4f7bc
Size (sslh-1.18.tar.gz) = 53175 bytes
SHA1 (patch-common.c) = 9cef21e4d81949b81b7d036bb00106498edf3190
SHA1 (patch-common.h) = 63fb02a7630ae9c7903e936cbd9e6a0964725f36
SHA1 (patch-echosrv.c) = 611044fd7ed1fd52c44e2d8ff393091c35478e17
SHA1 (patch-sslh-main.c) = a74502a087b11c4d8f32791ac86c45c7a38923d9
SHA1 (patch-sslh-main.c) = ce6b2cbf6bfde2daf6735bbf74f78c60a54c4008
SHA1 (patch-sslh-select.c) = 493d3269041ed9861e00c06073713fbcf45b42fd
31 changes: 31 additions & 0 deletions net/sslh/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='@SMF_NAME@'>
<service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />

<!-- dependencies -->
<dependency name='fs-root' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/root' />
</dependency>
<dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/service'/>
</dependency>
<dependency name='config-file' grouping='require_all' restart_on='none' type='path'>
<service_fmri value='file://localhost/@PKG_SYSCONFDIR@/sslh.cfg' />
</dependency>

<exec_method type='method' name='start' exec='@PREFIX@/sbin/sslh -F@PKG_SYSCONFDIR@/sslh.cfg' timeout_seconds='60' />
<exec_method type='method' name='stop' exec=':kill' timeout_seconds='30' />

<template>
<common_name>
<loctext xml:lang='C'>SSL multiplexer service</loctext>
</common_name>
<documentation>
<manpage title='sslh' section='8' />
</documentation>
</template>
</service>
</service_bundle>
49 changes: 49 additions & 0 deletions net/sslh/patches/patch-common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
$NetBSD$

--- common.c.orig 2016-03-29 19:19:05.000000000 +0000
+++ common.c
@@ -237,7 +237,7 @@ int connect_addr(struct connection *cnx,
}

/* Store some data to write to the queue later */
-int defer_write(struct queue *q, void* data, int data_size)
+int defer_write(struct sslhqueue *q, void* data, int data_size)
{
char *p;
if (verbose)
@@ -261,7 +261,7 @@ int defer_write(struct queue *q, void* d
* Upon success, the number of bytes written is returned.
* Upon failure, -1 returned (e.g. connexion closed)
* */
-int flush_deferred(struct queue *q)
+int flush_deferred(struct sslhqueue *q)
{
int n;

@@ -313,7 +313,7 @@ void dump_connection(struct connection *
* returns FD_STALLED if data was read, could not be written, and has been
* stored in temporary buffer.
*/
-int fd2fd(struct queue *target_q, struct queue *from_q)
+int fd2fd(struct sslhqueue *target_q, struct sslhqueue *from_q)
{
char buffer[BUFSIZ];
int target, from, size_r, size_w;
@@ -594,7 +594,7 @@ void setup_syslog(const char* bin_name)
int res;

name1 = strdup(bin_name);
- res = asprintf(&name2, "%s[%d]", basename(name1), getpid());
+ res = asprintf(&name2, "%s[%d]", basename(name1), (int)getpid());
CHECK_RES_DIE(res, "asprintf");
openlog(name2, LOG_CONS, LOG_AUTH);
free(name1);
@@ -694,7 +694,7 @@ void write_pid_file(const char* pidfile)
exit(3);
}

- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%d\n", (int)getpid());
fclose(f);
}

42 changes: 42 additions & 0 deletions net/sslh/patches/patch-common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$NetBSD$

--- common.h.orig 2016-03-29 19:19:05.000000000 +0000
+++ common.h
@@ -69,7 +69,7 @@ enum connection_state {

/* A 'queue' is composed of a file descriptor (which can be read from or
* written to), and a queue for deferred write data */
-struct queue {
+struct sslhqueue {
int fd;
void *begin_deferred_data;
void *deferred_data;
@@ -84,7 +84,7 @@ struct connection {
/* q[0]: queue for external connection (client);
* q[1]: queue for internal connection (httpd or sshd);
* */
- struct queue q[2];
+ struct sslhqueue q[2];
};

#define FD_CNXCLOSED 0
@@ -95,7 +95,7 @@ struct connection {
/* common.c */
void init_cnx(struct connection *cnx);
int connect_addr(struct connection *cnx, int fd_from);
-int fd2fd(struct queue *target, struct queue *from);
+int fd2fd(struct sslhqueue *target, struct sslhqueue *from);
char* sprintaddr(char* buf, size_t size, struct addrinfo *a);
void resolve_name(struct addrinfo **out, char* fullname);
void log_connection(struct connection *cnx);
@@ -110,8 +110,8 @@ int resolve_split_name(struct addrinfo *

int start_listen_sockets(int *sockfd[], struct addrinfo *addr_list);

-int defer_write(struct queue *q, void* data, int data_size);
-int flush_deferred(struct queue *q);
+int defer_write(struct sslhqueue *q, void* data, int data_size);
+int flush_deferred(struct sslhqueue *q);

extern int probing_timeout, verbose, inetd, foreground,
background, transparent, numeric;
14 changes: 10 additions & 4 deletions net/sslh/patches/patch-sslh-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@

--- sslh-main.c.orig 2016-03-29 19:19:05.000000000 +0000
+++ sslh-main.c
@@ -443,7 +443,7 @@ static void cmdline_config(int argc, cha
@@ -443,7 +443,11 @@ static void cmdline_config(int argc, cha
#ifdef LIBCONFIG
optind = 1;
opterr = 0; /* we're missing protocol options at this stage so don't output errors */
- while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) {
+#ifdef BSD
+ while ((c = getopt_long(argc, argv, optstr, all_options, NULL)) != -1) {
+#else
while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) {
+#endif
if (c == 'v') {
verbose++;
}
@@ -480,7 +480,7 @@ static void parse_cmdline(int argc, char
@@ -480,7 +484,11 @@ static void parse_cmdline(int argc, char
optind = 1;
opterr = 1;
next_arg:
- while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) {
+#ifdef BSD
+ while ((c = getopt_long(argc, argv, optstr, all_options, NULL)) != -1) {
+#else
while ((c = getopt_long_only(argc, argv, optstr, all_options, NULL)) != -1) {
+#endif
if (c == 0) continue;

if (c >= PROT_SHIFT) {
23 changes: 23 additions & 0 deletions net/sslh/patches/patch-sslh-select.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$NetBSD$

--- sslh-select.c.orig 2016-03-29 19:19:05.000000000 +0000
+++ sslh-select.c
@@ -131,7 +131,7 @@ int accept_new_connection(int listen_soc
/* Connect queue 1 of connection to SSL; returns new file descriptor */
int connect_queue(struct connection *cnx, fd_set *fds_r, fd_set *fds_w)
{
- struct queue *q = &cnx->q[1];
+ struct sslhqueue *q = &cnx->q[1];

q->fd = connect_addr(cnx, cnx->q[0].fd);
if ((q->fd != -1) && fd_is_in_range(q->fd)) {
@@ -156,7 +156,8 @@ int connect_queue(struct connection *cnx
void shovel(struct connection *cnx, int active_fd,
fd_set *fds_r, fd_set *fds_w)
{
- struct queue *read_q, *write_q;
+ struct sslhqueue *read_q, *write_q;
+

read_q = &cnx->q[active_fd];
write_q = &cnx->q[1-active_fd];