aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/spf.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-12-18 17:48:06 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-12-18 17:48:06 +0300
commitc6e6ea88a2e03609b0be013d2df0de1c6062712f (patch)
tree7492bb4cb0d47466c900319fa040b0d428560431 /src/plugins/spf.c
parent1b1bcd6966f47a2568acee011dd4b9f18195d765 (diff)
downloadrspamd-c6e6ea88a2e03609b0be013d2df0de1c6062712f.tar.gz
rspamd-c6e6ea88a2e03609b0be013d2df0de1c6062712f.zip
* Add limits support to each worker (max open files and max core size)
* Fix dependency on lex and yacc sources
Diffstat (limited to 'src/plugins/spf.c')
-rw-r--r--src/plugins/spf.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index b597da1e5..581f08b84 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -144,28 +144,30 @@ spf_plugin_callback (struct spf_record *record, struct worker_task *task)
s = ntohl (task->from_addr.s_addr);
while (cur) {
addr = cur->data;
- if (addr->mask == 0) {
- m = 0;
- }
- else {
- m = G_MAXUINT32 << (32 - addr->mask);
- }
- if ((s & m) == (addr->addr & m)) {
- switch (addr->mech) {
- case SPF_FAIL:
- insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_fail, 1, g_list_prepend (NULL, addr->spf_string));
- break;
- case SPF_SOFT_FAIL:
- case SPF_NEUTRAL:
- insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_softfail, 1, g_list_prepend (NULL, addr->spf_string));
- break;
- default:
- insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_allow, 1, g_list_prepend (NULL, addr->spf_string));
- break;
- }
- /* Stop parsing */
- break;
- }
+ if (addr != NULL) {
+ if (addr->mask == 0) {
+ m = 0;
+ }
+ else {
+ m = G_MAXUINT32 << (32 - addr->mask);
+ }
+ if ((s & m) == (addr->addr & m)) {
+ switch (addr->mech) {
+ case SPF_FAIL:
+ insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_fail, 1, g_list_prepend (NULL, addr->spf_string));
+ break;
+ case SPF_SOFT_FAIL:
+ case SPF_NEUTRAL:
+ insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_softfail, 1, g_list_prepend (NULL, addr->spf_string));
+ break;
+ default:
+ insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_allow, 1, g_list_prepend (NULL, addr->spf_string));
+ break;
+ }
+ /* Stop parsing */
+ break;
+ }
+ }
cur = g_list_next (cur);
}
}