netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: JM <jeevhi@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: inserting rule at the top of the chain using libnftnl
Date: Mon, 31 Aug 2020 22:32:58 +0530	[thread overview]
Message-ID: <CALiWujLPe4WZyUjgGzS6BTzWdTh4EDWZ7gYDUDOZYBSN4AYKqw@mail.gmail.com> (raw)

Hi,

I use libnftnl to manage our firewall and adding rules to the chain. I
am using libnftnl-1.1.7/examples/nft-rule-add.c as the reference.

I have no issues appending a rule or inserting AFTER a certain rule
using NFTNL_RULE_POSITION or NFTNL_RULE_POSITION.

However, I am struggling to insert a rule at the top of the chain. I
am unable to find a way to insert a rule BEFORE another rule or top of
the chain so that the rule is the first rule.

Can someone help, please

Jim

                 reply	other threads:[~2020-08-31 17:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALiWujLPe4WZyUjgGzS6BTzWdTh4EDWZ7gYDUDOZYBSN4AYKqw@mail.gmail.com \
    --to=jeevhi@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).