Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/bind/dist/bin/named don't "clean up" the blackl...
details: https://anonhg.NetBSD.org/src/rev/dc34eee247dd
branches: trunk
changeset: 350468:dc34eee247dd
user: spz <spz%NetBSD.org@localhost>
date: Thu Jan 12 08:38:31 2017 +0000
description:
don't "clean up" the blacklistd integration
diffstat:
external/bsd/bind/dist/bin/named/pfilter.c | 47 ++++++++++++++++++++++++++++++
external/bsd/bind/dist/bin/named/pfilter.h | 2 +
2 files changed, 49 insertions(+), 0 deletions(-)
diffs (57 lines):
diff -r bd7efdadf100 -r dc34eee247dd external/bsd/bind/dist/bin/named/pfilter.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/bind/dist/bin/named/pfilter.c Thu Jan 12 08:38:31 2017 +0000
@@ -0,0 +1,47 @@
+#include <config.h>
+
+#include <isc/platform.h>
+#include <isc/util.h>
+#include <named/types.h>
+#include <named/client.h>
+
+#include <blacklist.h>
+
+#include "pfilter.h"
+
+static struct blacklist *blstate;
+
+void
+pfilter_open(void)
+{
+ if (blstate == NULL)
+ blstate = blacklist_open();
+}
+
+#define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
+
+void
+pfilter_notify(isc_result_t res, ns_client_t *client, const char *msg)
+{
+ isc_socket_t *socket;
+
+ pfilter_open();
+
+ if (TCP_CLIENT(client))
+ socket = client->tcpsocket;
+ else {
+ socket = client->udpsocket;
+ if (!client->peeraddr_valid)
+ return;
+ }
+
+ if (socket == NULL)
+ return;
+
+ if (blstate == NULL)
+ return;
+
+ blacklist_sa_r(blstate,
+ res != ISC_R_SUCCESS, isc_socket_getfd(socket),
+ &client->peeraddr.type.sa, client->peeraddr.length, msg);
+}
diff -r bd7efdadf100 -r dc34eee247dd external/bsd/bind/dist/bin/named/pfilter.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/bind/dist/bin/named/pfilter.h Thu Jan 12 08:38:31 2017 +0000
@@ -0,0 +1,2 @@
+void pfilter_open(void);
+void pfilter_notify(isc_result_t, ns_client_t *, const char *);
Home |
Main Index |
Thread Index |
Old Index