netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Yakubov <yacudzer@mail.ru>
To: netfilter-devel@vger.kernel.org
Subject: nftables bug?? Maybe
Date: Tue, 29 Sep 2020 11:14:51 +0300	[thread overview]
Message-ID: <1452886108.20200929111451@mail.ru> (raw)

Hello, Netfilter-devel.


I tried to make autoload rules to nftables.

First, I created file with set of ipv4 addresses and apply it:

yacudzer@adm-ovpn-03:/etc/nftables$ cat OpenVPN_set_PRD-RMQ-star.nft
table ip filter {
    set OpenVPN_set_PRD-RMQ-star {
        type ipv4_addr
        elements = {
                    10.22.0.62,                   10.22.0.93,                   10.22.0.95
        }
    }
}
yacudzer@adm-ovpn-03:/etc/nftables$ sudo nft -f OpenVPN_set_PRD-RMQ-star.nft


Then, I created file with applying this set:
yacudzer@adm-ovpn-03:/etc/nftables$ cat ovpn-RabbitMQ.nft
add chain filter OpenVPN-RabbitMQ
flush chain filter OpenVPN-RabbitMQ

table ip filter {
    set OpenVPN_set_PRD-RMQ-star {
        type ipv4_addr
        elements = {
                    10.22.0.62,                   10.22.0.93,                   10.22.0.95
        }
    }
        chain OpenVPN-RabbitMQ {
                ip daddr @OpenVPN_set_PRD-RMQ-star accept
                return
        }
}

And when I tried to apply it, I see this error message:
yacudzer@adm-ovpn-03:/etc/nftables$ sudo nft -f ovpn-RabbitMQ.nft
ovpn-RabbitMQ.nft:6:26-50: Error: Set 'OpenVPN_set_PRD-RMQ-star' does not exist
                ip daddr @OpenVPN_set_PRD-RMQ-star accept
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^

If I place set rule in same file - everything OK:

yacudzer@adm-ovpn-03:/etc/nftables$ cat ovpn-RabbitMQ.nft
add chain filter OpenVPN-RabbitMQ
flush chain filter OpenVPN-RabbitMQ

table ip filter {
    set OpenVPN_set_PRD-RMQ-star {
        type ipv4_addr
        elements = {
                    10.22.0.62,                   10.22.0.93,                   10.22.0.95
        }
    }
        chain OpenVPN-RabbitMQ {
                ip daddr @OpenVPN_set_PRD-RMQ-star accept
                return
        }
}
yacudzer@adm-ovpn-03:/etc/nftables$ sudo nft -f ovpn-RabbitMQ.nft


But error only when set and rule in different files.
I think that it a bug.

I tried versions 0.9.0 (in debian repo) and 0.9.6 (compiled manually).

-- 
С уважением,
 Evgeniy                          mailto:yacudzer@mail.ru


                 reply	other threads:[~2020-09-29  8:51 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=1452886108.20200929111451@mail.ru \
    --to=yacudzer@mail.ru \
    --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).