Hello,

It seems that I didn't test sniproxy deep enough after the patch removal for STAILQ_*. There are core dumps with sniproxy without the patch.

Here is a diff which brings back the patch and also solves the compilation error with the -fno-common change.

I need to check if it's possible to make that cleaner, but in the meantime sniproxy works again.

Best Regards

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/sniproxy/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile	8 Apr 2020 04:56:52 -0000	1.1.1.1
+++ Makefile	9 Feb 2021 14:15:17 -0000
@@ -6,6 +6,8 @@ GH_ACCOUNT =	dlundquist
 GH_PROJECT =	sniproxy
 GH_TAGNAME =	0.6.0
 
+REVISION =	0
+
 CATEGORIES =	net
 
 HOMEPAGE =	https://github.com/dlundquist/sniproxy
Index: patches/patch-src_backend_h
===================================================================
RCS file: patches/patch-src_backend_h
diff -N patches/patch-src_backend_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_backend_h	9 Feb 2021 14:15:17 -0000
@@ -0,0 +1,95 @@
+$OpenBSD: patch-src_backend_h,v 1.1.1.1 2020/04/08 04:56:52 bket Exp $
+
+Index: src/backend.h
+--- src/backend.h.orig
++++ src/backend.h
+@@ -31,6 +31,89 @@
+ #include <pcre.h>
+ #include "address.h"
+ 
++#ifndef STAILQ_INIT
++/*
++ * Singly-linked Tail queue declarations.
++ */
++#define STAILQ_HEAD(name, type)                                 \
++struct name {                                                           \
++        struct type *stqh_first;        /* first element */                     \
++        struct type **stqh_last;        /* addr of last next element */         \
++}
++
++#define STAILQ_HEAD_INITIALIZER(head)                                   \
++        { NULL, &(head).stqh_first }
++
++#define STAILQ_ENTRY(type)                                              \
++struct {                                                                \
++        struct type *stqe_next; /* next element */                      \
++}
++
++/*
++ * Singly-linked Tail queue functions.
++ */
++#define STAILQ_INIT(head) do {                                          \
++        (head)->stqh_first = NULL;                                      \
++        (head)->stqh_last = &(head)->stqh_first;                                \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_HEAD(head, elm, field) do {                       \
++        if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)      \
++                (head)->stqh_last = &(elm)->field.stqe_next;            \
++        (head)->stqh_first = (elm);                                     \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_TAIL(head, elm, field) do {                       \
++        (elm)->field.stqe_next = NULL;                                  \
++        *(head)->stqh_last = (elm);                                     \
++        (head)->stqh_last = &(elm)->field.stqe_next;                    \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do {             \
++        if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
++                (head)->stqh_last = &(elm)->field.stqe_next;            \
++        (listelm)->field.stqe_next = (elm);                             \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE_HEAD(head, field) do {                            \
++        if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
++                (head)->stqh_last = &(head)->stqh_first;                        \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE(head, elm, type, field) do {                      \
++        if ((head)->stqh_first == (elm)) {                              \
++                STAILQ_REMOVE_HEAD((head), field);                      \
++        } else {                                                        \
++                struct type *curelm = (head)->stqh_first;               \
++                while (curelm->field.stqe_next != (elm))                        \
++                        curelm = curelm->field.stqe_next;               \
++                if ((curelm->field.stqe_next =                          \
++                        curelm->field.stqe_next->field.stqe_next) == NULL) \
++                            (head)->stqh_last = &(curelm)->field.stqe_next; \
++        }                                                               \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_FOREACH(var, head, field)                                \
++        for ((var) = ((head)->stqh_first);                              \
++                (var);                                                  \
++                (var) = ((var)->field.stqe_next))
++
++#define STAILQ_CONCAT(head1, head2) do {                                \
++        if (!STAILQ_EMPTY((head2))) {                                   \
++                *(head1)->stqh_last = (head2)->stqh_first;              \
++                (head1)->stqh_last = (head2)->stqh_last;                \
++                STAILQ_INIT((head2));                                   \
++        }                                                               \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Singly-linked Tail queue access methods.
++ */
++#define STAILQ_EMPTY(head)      ((head)->stqh_first == NULL)
++#define STAILQ_FIRST(head)      ((head)->stqh_first)
++#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
++#endif
++
+ STAILQ_HEAD(Backend_head, Backend);
+ 
+ struct Backend {
Index: patches/patch-src_http_c
===================================================================
RCS file: patches/patch-src_http_c
diff -N patches/patch-src_http_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_http_c	9 Feb 2021 14:15:17 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/http.c
+--- src/http.c.orig
++++ src/http.c
+@@ -45,7 +45,7 @@ static const char http_503[] =
+     "Connection: close\r\n\r\n"
+     "Backend not available";
+ 
+-const struct Protocol *const http_protocol = &(struct Protocol){
++static const struct Protocol *const http_protocol = &(struct Protocol){
+     .name = "http",
+     .default_port = 80,
+     .parse_packet = &parse_http_header,
Index: patches/patch-src_http_h
===================================================================
RCS file: patches/patch-src_http_h
diff -N patches/patch-src_http_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_http_h	9 Feb 2021 14:15:17 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: src/http.h
+--- src/http.h.orig
++++ src/http.h
+@@ -29,6 +29,6 @@
+ #include <stdio.h>
+ #include "protocol.h"
+ 
+-const struct Protocol *const http_protocol;
++static const struct Protocol *const http_protocol;
+ 
+ #endif
Index: patches/patch-src_tls_c
===================================================================
RCS file: patches/patch-src_tls_c
diff -N patches/patch-src_tls_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tls_c	9 Feb 2021 14:15:17 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/tls.c
+--- src/tls.c.orig
++++ src/tls.c
+@@ -60,7 +60,7 @@ static const char tls_alert[] = {
+     0x02, 0x28, /* Fatal, handshake failure */
+ };
+ 
+-const struct Protocol *const tls_protocol = &(struct Protocol){
++static const struct Protocol *const tls_protocol = &(struct Protocol){
+     .name = "tls",
+     .default_port = 443,
+     .parse_packet = (int (*const)(const char *, size_t, char **))&parse_tls_header,
Index: patches/patch-src_tls_h
===================================================================
RCS file: patches/patch-src_tls_h
diff -N patches/patch-src_tls_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tls_h	9 Feb 2021 14:15:17 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: src/tls.h
+--- src/tls.h.orig
++++ src/tls.h
+@@ -28,6 +28,6 @@
+ 
+ #include "protocol.h"
+ 
+-const struct Protocol *const tls_protocol;
++static const struct Protocol *const tls_protocol;
+ 
+ #endif

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to