netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yanchuan Nian <ycnian@gmail.com>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, Yanchuan Nian <ycnian@gmail.com>
Subject: Bug: nft cannot identify elements in set correctly
Date: Mon, 11 Aug 2014 17:18:31 +0800	[thread overview]
Message-ID: <1407748711-21183-1-git-send-email-ycnian@gmail.com> (raw)

nft cannot identify elements in set correctly, look at the result of
following commands.

[root@localhost ~]# nft add set ip filter servicelist {type inet_service \;}
[root@localhost ~]# nft add element ip filter servicelist {ftp,ssh}
<cmdline>:1:35-37: Error: syntax error, unexpected string, expecting '{'
add element ip filter servicelist ftp ssh
                                  ^^^
[root@localhost ~]# nft add element ip filter servicelist {ftp, ssh}

There must be a space between ftp and ssh, otherwise bison ignores "{".
But it's strange that this bug doesn't exist in interactive mode.

[root@localhost nftables]# nft -i
nft> delete element ip filter servicelist {ftp,ssh}
nft> add element ip filter servicelist {ftp,ssh}
nft> 
nft> list table ip filter
table ip filter {
	set servicelist { 
		type inet_service
		elements = { ssh, ftp}
	}
}
nft> 

What's the difference between shell mode and interactive mode? I thought
they are the same except you don't need to type "nft" at the beginning
of each command in interactive mode.

             reply	other threads:[~2014-08-11  9:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11  9:18 Yanchuan Nian [this message]
2014-08-11  9:32 ` Bug: nft cannot identify elements in set correctly Florian Westphal

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=1407748711-21183-1-git-send-email-ycnian@gmail.com \
    --to=ycnian@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).