From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: Creating a map programmatically using the C library libnftnl Date: Thu, 30 Mar 2023 21:55:53 +0200 Message-ID: <20230330195553.GC22079@breakpoint.cc> References: <20230328150941.GB25361@breakpoint.cc> <20230330160954.GA22225@breakpoint.cc> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kiernan George Cc: Florian Westphal , netfilter@vger.kernel.org Kiernan George wrote: > That works to create the map, but when I go to add an element through > the command line it fails with this error: > > root@laptop:/tmp# nft add element netdev example test2 { 1.1.1.1 . > 1111 : 2.2.2.2 } > Error: Could not process rule: File exists > add element netdev example test2 { 1.1.1.1 . 1111 : 2.2.2.2 } > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Do you have any insight? Worksforme. 'File exists' hints that you are adding the same element again. The key has to be unique, so: add element netdev example test2 { 1.1.1.1 . 1111 : 2.2.2.2 } add element netdev example test2 { 1.1.1.1 . 1111 : 2.2.2.3 } // Fails even if value is different