From patchwork Sat Jan 18 21:06:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arturo Borrero X-Patchwork-Id: 312332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9C0ED2C009F for ; Sun, 19 Jan 2014 08:07:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbaARVHD (ORCPT ); Sat, 18 Jan 2014 16:07:03 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:59474 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393AbaARVHD convert rfc822-to-8bit (ORCPT ); Sat, 18 Jan 2014 16:07:03 -0500 Received: by mail-lb0-f172.google.com with SMTP id c11so3955457lbj.3 for ; Sat, 18 Jan 2014 13:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=d3iP4EHTcRve/FPw+YTGrICw5loLGwMutyEIVjoPzIE=; b=xl9PvxQJVQKPAJa7P4ZXiZ3B0MObF1sVUcfuGZORW+cYr3YXvIXKkl/BvvDL2U17ik tYzioV5UdCQPqUznJa/ZWfKrNFPtkToiS15rvt+ZrnghLljevxNu1JW3xBRuyOeo8oO1 h3qxXKIcisRqLHkeMoSefkAGadMJZxv/PwWEmEtUibVXLVA+yj7Rj7cz19XUAFeDKICq 6co1fyPBhLjkUFGxfM48xmkfSbdtdTqwEJlJ/ypn+KhbUspQBVZgiyKM9hS3vXOZo7iV SXjPVPEGQLXtMqSKPGRxa9YuAzOVlnySlSeMUQPEtFsa/V7Mlc0cDB9ykUHXdnpm52hb HArw== X-Received: by 10.152.22.130 with SMTP id d2mr2044301laf.39.1390079221199; Sat, 18 Jan 2014 13:07:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.219.229 with HTTP; Sat, 18 Jan 2014 13:06:41 -0800 (PST) In-Reply-To: <20140118205321.GB4840@localhost> References: <20140118163944.23453.46552.stgit@nfdev.cica.es> <20140118205321.GB4840@localhost> From: Arturo Borrero Gonzalez Date: Sat, 18 Jan 2014 22:06:41 +0100 Message-ID: Subject: Re: [libnftables PATCH] data_reg: fix verdict format approach To: Pablo Neira Ayuso Cc: Netfilter Development Mailing list , Patrick McHardy Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org On 18 January 2014 21:53, Pablo Neira Ayuso wrote: > On Sat, Jan 18, 2014 at 05:39:44PM +0100, Arturo Borrero Gonzalez wrote: >> Patrick reports that the XML/JSON formats of the data_reg object >> are not accuarate. >> >> This patch updates these formats, so they are now as follow: >> >> * with raw data (this doesn't change). >> * with a concrete verdict (eg drop accept) and an >> optional , with destination. > > Applied. > I included an unrelated change! :( i'm very sorry. What should I do? >> In XML: >> > ^------------^ > > I think we decided time ago that we prefer elements instead of > attributes. I would take a patch for that conversion. I think this particular case is more like in expressions. We need a 'type' attribute, so we can know which nodes to expect inside . I think the absence of this 'type' attribute may harden the parsing, validating and error reporting. Don't you? diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index b2ad62e..df981ad 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -121,6 +121,7 @@ failparsing: fclose(fp); printf("parsing %s: ", filename); printf("\033[31mFAILED\e[0m (%s)\n", strerror(errno)); + nft_parse_perror("fail", err); return -1; }