diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-08-30 19:18:42 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-08-31 18:40:14 +0200 |
commit | 1524134b0bc013bf8facd62295dd537197d95230 (patch) | |
tree | ce43e4b4bf0c080a7bd6312b52a61531f8192f00 /src/evaluate.c | |
parent | 2de594ccb99c70bc908a3f4cc477618babffff6b (diff) |
src: osf: load pf.os from expr_evaluate_osf()
Remove osf_init variable and call nfnl_osf_load_fingerprints() from
expr_evaluate_osf() instead of doing that from do_command_add() path.
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 9a7118ec..19550823 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -26,6 +26,8 @@ #include <expression.h> #include <statement.h> +#include <netlink.h> +#include <time.h> #include <rule.h> #include <erec.h> #include <gmputil.h> @@ -1727,6 +1729,15 @@ static int expr_evaluate_socket(struct eval_ctx *ctx, struct expr **expr) static int expr_evaluate_osf(struct eval_ctx *ctx, struct expr **expr) { + struct netlink_ctx nl_ctx = { + .nf_sock = ctx->nf_sock, + .debug_mask = ctx->debug_mask, + .octx = ctx->octx, + .seqnum = time(NULL), + }; + + nfnl_osf_load_fingerprints(&nl_ctx, 0); + return expr_evaluate_primary(ctx, expr); } |