diff options
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c index 0190e94..0d3dc2b 100644 --- a/src/object.c +++ b/src/object.c @@ -276,6 +276,7 @@ static int nftnl_jansson_parse_obj(struct nftnl_obj *t, json_t *tree, struct nftnl_parse_err *err) { const char *str; + uint32_t type; json_t *root; root = nftnl_jansson_get_node(tree, "obj", err); @@ -290,6 +291,10 @@ static int nftnl_jansson_parse_obj(struct nftnl_obj *t, json_t *tree, if (str != NULL) nftnl_obj_set_str(t, NFTNL_OBJ_NAME, str); + if (nftnl_jansson_parse_val(root, "type", NFTNL_TYPE_U32, &type, + err) < 0) + nftnl_obj_set_u32(t, NFTNL_OBJ_TYPE, type); + return 0; } #endif |