diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-10-23 17:06:22 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-23 17:46:47 +0200 |
commit | 03eafe098d5eead786cbbe6f79348f05819cd99e (patch) | |
tree | 852498d1288759dafa8773c04fc24e3f54d4512a /src/parser_json.c | |
parent | d7ef1e206bd9b36607dddcf337fada11d743b61f (diff) |
osf: add ttl option support
Add support for ttl option in "osf" expression. Example:
table ip foo {
chain bar {
type filter hook input priority filter; policy accept;
osf ttl skip name "Linux"
}
}
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_json.c')
-rw-r--r-- | src/parser_json.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser_json.c b/src/parser_json.c index 7047c00d..fc0dc9a9 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -376,12 +376,13 @@ static struct expr *json_parse_osf_expr(struct json_ctx *ctx, const char *type, json_t *root) { const char *key; + uint8_t ttl; - if (json_unpack_err(ctx, root, "{s:s}", "key", &key)) + if (json_unpack_err(ctx, root, "{s:i, s:s}", "ttl", ttl,"key", &key)) return NULL; if (!strcmp(key, "name")) - return osf_expr_alloc(int_loc); + return osf_expr_alloc(int_loc, ttl); json_error(ctx, "Invalid osf key value."); return NULL; |