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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 4A8ECC04E87 for ; Sat, 18 May 2019 07:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C5C02087E for ; Sat, 18 May 2019 07:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728688AbfERHga (ORCPT ); Sat, 18 May 2019 03:36:30 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:57980 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbfERHga (ORCPT ); Sat, 18 May 2019 03:36:30 -0400 Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.91) (envelope-from ) id 1hRttM-0002cd-3I; Sat, 18 May 2019 09:36:28 +0200 Date: Sat, 18 May 2019 09:36:28 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: Florian Westphal , netfilter-devel@vger.kernel.org Subject: Refcounts in libnftnl? Message-ID: <20190518073628.GH4851@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Pablo Neira Ayuso , Florian Westphal , netfilter-devel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Hi! Probably the best way to fix for the segfaults caused by Florian's cache rebuild logic in iptables-nft is to introduce reference counts so we don't have to care about whether a given object is present only in cache or also in a batch job. Unlike nftables, iptables-nft code uses libnftnl data structures instead of its own ones. I wonder if it is OK to add refcounts to libnftnl types instead of implementing wrapper structures for everything in iptables-nft. What do you think? Cheers, Phil