Skip to content

Commit f6013b9

Browse files
authored
skip p0f on private IPs (haraka#1758)
1 parent 116e9f1 commit f6013b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/connect.p0f.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ exports.hook_init_child = function (next, server) {
191191

192192
exports.hook_lookup_rdns = function onLookup(next, connection) {
193193
var plugin = this;
194+
if (connection.remote.is_private) return next();
195+
194196
if (!server.notes.p0f_client) {
195197
connection.logerror(plugin, 'missing server');
196198
return next();
197199
}
200+
198201
var p0f_client = server.notes.p0f_client;
199202
p0f_client.query(connection.remote.ip, function (err, result) {
200203
if (err) {
@@ -225,6 +228,8 @@ function format_results(r) {
225228

226229
exports.hook_data_post = function (next, connection) {
227230
var plugin = this;
231+
if (connection.remote.is_private) return next();
232+
228233
var header_name = plugin.cfg.main.add_header;
229234
if (!header_name) {
230235
connection.logdebug(plugin, 'header disabled in ini' );

0 commit comments

Comments
 (0)