diff options
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -486,17 +486,6 @@ static int nft_rule_xml_parse(struct nft_rule *r, char *xml) if (tree == NULL) return -1; - /* validate XML version <rule ... version=X ... > */ - if (mxmlElementGetAttr(tree, "version") == NULL) { - mxmlDelete(tree); - return -1; - } - tmp = strtoll(mxmlElementGetAttr(tree, "version"), &endptr, 10); - if (tmp == LLONG_MAX || *endptr || tmp != NFT_RULE_XML_VERSION) { - mxmlDelete(tree); - return -1; - } - /* get and set <rule ... family=X ... > */ if (mxmlElementGetAttr(tree, "family") == NULL) { mxmlDelete(tree); @@ -644,10 +633,9 @@ static int nft_rule_snprintf_json(char *buf, size_t size, struct nft_rule *r, ret = snprintf(buf, size, "{ \"rule\": { \"family\" : \"%s\", \"table\" : \"%s\", " - "\"chain\" : \"%s\", \"handle\" : %llu, \"version\" : %d, ", + "\"chain\" : \"%s\", \"handle\" : %llu,", nft_family2str(r->family), r->table, r->chain, - (unsigned long long)r->handle, - NFT_RULE_JSON_VERSION); + (unsigned long long)r->handle); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = snprintf(buf+offset, len, "\"rule_flags\" : %u, ", @@ -690,10 +678,9 @@ static int nft_rule_snprintf_xml(char *buf, size_t size, struct nft_rule *r, ret = snprintf(buf, size, "<rule family=\"%s\" table=\"%s\" " - "chain=\"%s\" handle=\"%llu\" version=\"%d\">", + "chain=\"%s\" handle=\"%llu\">", nft_family2str(r->family), r->table, r->chain, - (unsigned long long)r->handle, - NFT_RULE_XML_VERSION); + (unsigned long long)r->handle); SNPRINTF_BUFFER_SIZE(ret, size, len, offset); ret = snprintf(buf+offset, len, "<rule_flags>%u</rule_flags>", |