aboutsummaryrefslogtreecommitdiffstats
path: root/net/honeyd
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-07-24 21:32:58 +0800
committerbapt <bapt@FreeBSD.org>2014-07-24 21:32:58 +0800
commita8844613fabe6f02880be5a2bbab4d9af2853c2d (patch)
treeffddb673c48038e781d69f6c3d08ec8855ad33a5 /net/honeyd
parent12f33c255d02d5e8b350ff2daf6aa8ed112b6508 (diff)
downloadfreebsd-ports-gnome-a8844613fabe6f02880be5a2bbab4d9af2853c2d.tar.gz
freebsd-ports-gnome-a8844613fabe6f02880be5a2bbab4d9af2853c2d.tar.zst
freebsd-ports-gnome-a8844613fabe6f02880be5a2bbab4d9af2853c2d.zip
Only use libevent2
Remove libevent as libevent2 is providing a good compatibility interface as well as providing better performances. Remove custom patches from libevent2 and install libevent2 the regular way Mark ports abusing private fields of the libevent1 API as broken Import a patch from fedora to have honeyd working with libevent2 Remove most of the patches necessary to find the custom installation we used to have for libevent2 With hat: portmgr
Diffstat (limited to 'net/honeyd')
-rw-r--r--net/honeyd/Makefile6
-rw-r--r--net/honeyd/files/honeyd-1.5c-libevent2.patch211
2 files changed, 215 insertions, 2 deletions
diff --git a/net/honeyd/Makefile b/net/honeyd/Makefile
index a0446276ef3f..c3337cfa5b83 100644
--- a/net/honeyd/Makefile
+++ b/net/honeyd/Makefile
@@ -3,7 +3,7 @@
PORTNAME= honeyd
PORTVERSION= 1.5c
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= net
MASTER_SITES= http://www.honeyd.org/uploads/ \
http://www.citi.umich.edu/u/provos/honeyd/
@@ -13,7 +13,7 @@ COMMENT= Simulate virtual network hosts (honeypots)
LICENSE= GPLv2
-LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent \
+LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent2 \
libdnet.so:${PORTSDIR}/net/libdnet \
libpcre.so:${PORTSDIR}/devel/pcre
@@ -23,6 +23,8 @@ GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-libdnet=${LOCALBASE} \
--with-libevent=${LOCALBASE}
+EXTRA_PATCHES= ${FILESDIR}/honeyd-1.5c-libevent2.patch:-p1
+
.if defined(WITH_PYTHON)
USE_PYTHON= yes
CONFIGURE_ARGS+= --with-python
diff --git a/net/honeyd/files/honeyd-1.5c-libevent2.patch b/net/honeyd/files/honeyd-1.5c-libevent2.patch
new file mode 100644
index 000000000000..34897ee7e514
--- /dev/null
+++ b/net/honeyd/files/honeyd-1.5c-libevent2.patch
@@ -0,0 +1,211 @@
+diff -up honeyd-1.5c/honeydstats.c.libevent2 honeyd-1.5c/honeydstats.c
+--- honeyd-1.5c/honeydstats.c.libevent2 2007-05-28 08:12:52.000000000 +0200
++++ honeyd-1.5c/honeydstats.c 2011-07-26 13:18:14.459666984 +0200
+@@ -330,30 +330,43 @@ signature_process(struct evbuffer *evbuf
+ static int
+ signature_length(struct evbuffer *evbuf)
+ {
+- struct evbuffer tmp;
++ struct evbuffer *tmp;
+ uint32_t length, tlen;
+
+- tmp = *evbuf;
+-
++ tmp = evbuffer_new();
++ tmp = evbuffer_add_reference(tmp, evbuffer_pullup(evbuf, -1),
++ evbuffer_get_length(evbuf), NULL, NULL);
+ /* name */
+- if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++ if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++ evbuffer_free(tmp);
+ return (-1);
++ }
++
++ if (evbuffer_drain(tmp, tlen) == -1) {
++ evbuffer_free(tmp);
++ return (-1);
++ }
+
+ length = tlen;
+- tmp.buffer += tlen;
+- tmp.off -= tlen;
+
+ /* signature */
+- if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++ if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++ evbuffer_free(tmp);
+ return (-1);
++ }
+
++ if (evbuffer_drain(tmp, tlen) == -1) {
++ evbuffer_free(tmp);
++ return (-1);
++ }
++
+ length += tlen;
+- tmp.buffer += tlen;
+- tmp.off -= tlen;
+
+ /* data */
+- if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++ if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++ evbuffer_free(tmp);
+ return (-1);
++ }
+
+ length += tlen;
+
+diff -up honeyd-1.5c/tagging.c.libevent2 honeyd-1.5c/tagging.c
+--- honeyd-1.5c/tagging.c.libevent2 2007-05-28 08:12:52.000000000 +0200
++++ honeyd-1.5c/tagging.c 2011-07-26 13:18:14.460666991 +0200
+@@ -73,7 +73,7 @@ tagging_init()
+ */
+
+ void
+-encode_int(struct evbuffer *evbuf, uint32_t number)
++encode__int(struct evbuffer *evbuf, uint32_t number)
+ {
+ int off = 1, nibbles = 0;
+ uint8_t data[5];
+@@ -108,7 +108,7 @@ void
+ tag_marshal(struct evbuffer *evbuf, uint8_t tag, void *data, uint16_t len)
+ {
+ evbuffer_add(evbuf, &tag, sizeof(tag));
+- encode_int(evbuf, len);
++ encode__int(evbuf, len);
+ evbuffer_add(evbuf, data, len);
+ }
+
+@@ -117,10 +117,10 @@ void
+ tag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer)
+ {
+ evbuffer_drain(_buf, EVBUFFER_LENGTH(_buf));
+- encode_int(_buf, integer);
++ encode__int(_buf, integer);
+
+ evbuffer_add(evbuf, &tag, sizeof(tag));
+- encode_int(evbuf, EVBUFFER_LENGTH(_buf));
++ encode__int(evbuf, EVBUFFER_LENGTH(_buf));
+ evbuffer_add_buffer(evbuf, _buf);
+ }
+
+@@ -135,8 +135,8 @@ tag_marshal_timeval(struct evbuffer *evb
+ {
+ evbuffer_drain(_buf, EVBUFFER_LENGTH(_buf));
+
+- encode_int(_buf, tv->tv_sec);
+- encode_int(_buf, tv->tv_usec);
++ encode__int(_buf, tv->tv_sec);
++ encode__int(_buf, tv->tv_usec);
+
+ tag_marshal(evbuf, tag, EVBUFFER_DATA(_buf),
+ EVBUFFER_LENGTH(_buf));
+diff -up honeyd-1.5c/tagging.h.libevent2 honeyd-1.5c/tagging.h
+--- honeyd-1.5c/tagging.h.libevent2 2007-05-28 08:12:52.000000000 +0200
++++ honeyd-1.5c/tagging.h 2011-07-26 13:18:14.461666999 +0200
+@@ -86,7 +86,7 @@ void addr_marshal(struct evbuffer *, str
+ void tag_marshal(struct evbuffer *evbuf, uint8_t tag, void *data,
+ uint16_t len);
+
+-void encode_int(struct evbuffer *evbuf, uint32_t number);
++void encode__int(struct evbuffer *evbuf, uint32_t number);
+
+ void tag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer);
+
+diff -up honeyd-1.5c/ui.c.libevent2 honeyd-1.5c/ui.c
+--- honeyd-1.5c/ui.c.libevent2 2007-05-28 08:12:52.000000000 +0200
++++ honeyd-1.5c/ui.c 2011-07-26 13:18:14.459666984 +0200
+@@ -246,7 +246,8 @@ ui_writer(int fd, short what, void *arg)
+ struct evbuffer *buffer = client->outbuf;
+ int n;
+
+- n = write(fd, buffer->buffer, buffer->off);
++ n = write(fd, evbuffer_pullup(buffer, -1),
++ evbuffer_get_length(buffer));
+ if (n == -1) {
+ if (errno == EINTR || errno == EAGAIN)
+ goto schedule;
+@@ -260,7 +261,7 @@ ui_writer(int fd, short what, void *arg)
+ evbuffer_drain(buffer, n);
+
+ schedule:
+- if (buffer->off)
++ if (evbuffer_get_length(buffer))
+ event_add(&client->ev_write, NULL);
+ }
+
+@@ -277,8 +278,8 @@ ui_handler(int fd, short what, void *arg
+ return;
+ }
+
+- n = mybuf->off;
+- p = mybuf->buffer;
++ n = evbuffer_get_length (mybuf);
++ p = evbuffer_pullup (mybuf, -1);
+ consumed = 0;
+ while (n--) {
+ consumed++;
+@@ -289,11 +290,12 @@ ui_handler(int fd, short what, void *arg
+ */
+ if (*p == '\n') {
+ *p = '\0';
+- ui_handle_command(client->outbuf, mybuf->buffer);
++ ui_handle_command(client->outbuf,
++ evbuffer_pullup(mybuf, -1));
+
+ evbuffer_drain(mybuf, consumed);
+- n = mybuf->off;
+- p = mybuf->buffer;
++ n = evbuffer_get_length (mybuf);
++ p = evbuffer_pullup (mybuf, -1);
+ consumed = 0;
+ continue;
+ }
+diff -up honeyd-1.5c/untagging.c.libevent2 honeyd-1.5c/untagging.c
+--- honeyd-1.5c/untagging.c.libevent2 2007-05-28 08:12:52.000000000 +0200
++++ honeyd-1.5c/untagging.c 2011-07-26 13:18:14.461666999 +0200
+@@ -114,22 +114,29 @@ tag_peek(struct evbuffer *evbuf, uint8_t
+ int
+ tag_peek_length(struct evbuffer *evbuf, uint32_t *plength)
+ {
+- struct evbuffer tmp;
++ struct evbuffer *tmp;
+ int res;
+
+ if (EVBUFFER_LENGTH(evbuf) < 2)
+ return (-1);
+
+- tmp = *evbuf;
+- tmp.buffer += 1;
+- tmp.off -= 1;
++ tmp = evbuffer_new ();
++ evbuffer_add_reference (tmp, evbuffer_pullup(evbuf, -1),
++ evbuffer_get_length(evbuf), NULL, NULL);
++ if (evbuffer_drain(tmp, 1) == -1) {
++ evbuffer_free (tmp);
++ return (-1);
++ }
+
+- res = decode_int_internal(plength, &tmp, 0);
+- if (res == -1)
++ res = decode_int_internal(plength, tmp, 0);
++ if (res == -1) {
++ evbuffer_free (tmp);
+ return (-1);
++ }
+
+ *plength += res + 1;
+
++ evbuffer_free (tmp);
+ return (0);
+ }
+
+@@ -438,7 +445,7 @@ tagging_int_test(void)
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ int oldlen, newlen;
+ oldlen = EVBUFFER_LENGTH(tmp);
+- encode_int(tmp, integers[i]);
++ encode__int(tmp, integers[i]);
+ newlen = EVBUFFER_LENGTH(tmp);
+ fprintf(stderr, "\t\tencoded 0x%08x with %d bytes\n",
+ integers[i], newlen - oldlen);