From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66C69C4741C for ; Sun, 19 Jan 2020 22:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3ED3E206B7 for ; Sun, 19 Jan 2020 22:57:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=azazel.net header.i=@azazel.net header.b="ClcNEt/u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728927AbgASW5M (ORCPT ); Sun, 19 Jan 2020 17:57:12 -0500 Received: from kadath.azazel.net ([81.187.231.250]:56574 "EHLO kadath.azazel.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728819AbgASW5L (ORCPT ); Sun, 19 Jan 2020 17:57:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KmMgoqWn7ueNl03jTazSW8TYy7jjDjWZuTEIREBRzEY=; b=ClcNEt/uMwCgVPrb5Z2cyip/xe y5orP1mxhMNnRu4exvEmmD+4GvJ67Zt4miOSWC42KeORiW+yXgQyw6WezWHKitBKlJS/C+rvlhKfZ mkRoHZLXTjfbrENAFcPf/4sJyHZsiyYZeuLHoaf0m+/aQCOGInR3bwZS95tKt+ZBGwYrFN+fTUyAU z4nuemimOKuYY7pU+pTArL2C+r1j0/DE/7HOxdkebiUACT5YLxdHAGSRoTjuBTeSsa0vBMZGDS65N nLaBDe50EYK4xKvoF/8jBXMMexyEbg3YxVez3jAf6WdqzL+glRI+j9v6/8vai2KzDvL/yXJB0Yuvx p/qhuGBQ==; Received: from [2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae] (helo=ulthar.dreamlands) by kadath.azazel.net with esmtp (Exim 4.92) (envelope-from ) id 1itJVG-0006wh-F9 for netfilter-devel@vger.kernel.org; Sun, 19 Jan 2020 22:57:10 +0000 From: Jeremy Sowden To: Netfilter Devel Subject: [PATCH nft v3 0/9] bitwise shift support Date: Sun, 19 Jan 2020 22:57:01 +0000 Message-Id: <20200119225710.222976-1-jeremy@azazel.net> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The kernel supports bitwise shift operations. This patch-set adds the support to nft. There are a few preliminary housekeeping patches. Changes since v2: * set the type and byte-order of righthand shift operands to integer and host-endian during delinearization; * always set the length of righthand shift operands to 32 bits during linearization. Changes since v1: * update to the final kernel and libnftnl API's; * update nf_tables.h in a separate patch; * change byte-order of payload shifts generated by expr_evaluate_bits. Jeremy Sowden (9): Update gitignore. src: white-space fixes. netlink_delinearize: fix typo. netlink_delinearize: remove commented out pr_debug statement. parser: add parenthesized statement expressions. evaluate: change shift byte-order to host-endian. include: update nf_tables.h. netlink: add support for handling shift expressions. tests: shell: add bit-shift tests. .gitignore | 9 ++ include/linux/netfilter/nf_tables.h | 23 +++++ src/evaluate.c | 13 ++- src/netlink_delinearize.c | 93 +++++++++++++++---- src/netlink_linearize.c | 52 ++++++++++- src/parser_bison.y | 25 ++--- tests/shell/testcases/chains/0040mark_shift_0 | 11 +++ tests/shell/testcases/chains/0040mark_shift_1 | 11 +++ .../chains/dumps/0040mark_shift_0.nft | 6 ++ .../chains/dumps/0040mark_shift_1.nft | 6 ++ 10 files changed, 208 insertions(+), 41 deletions(-) create mode 100755 tests/shell/testcases/chains/0040mark_shift_0 create mode 100755 tests/shell/testcases/chains/0040mark_shift_1 create mode 100644 tests/shell/testcases/chains/dumps/0040mark_shift_0.nft create mode 100644 tests/shell/testcases/chains/dumps/0040mark_shift_1.nft -- 2.24.1