]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: Initialize linear mapping of symbols in _init() of extension
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 1 Mar 2018 11:03:10 +0000 (13:03 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 27 Apr 2018 16:56:14 +0000 (18:56 +0200)
commit56aadc01b258ef7849463723ab5ddc4885db22f6
treeb8fb3f0c3c95231a0843ee5eb4386096b811f96e
parent79c2da9860d704e7e709a0612da1fdc5cde8b5fa
extensions: Initialize linear mapping of symbols in _init() of extension

libxt_devgroup and libipt_realm currently unable to display symbolic
names in save/print commands because linear mapping is not initialized.

It looks bit confusing as linear mapping initialization is done in init()
of extension, which is expected to be called before any other function of
extension.

However init is called only when '-m' option specified on command line,
that is true only for insert, append, replace and destroy iptables
commands.

Move initialization to extension _init() function before calling
any function in extension.

Before:
-------
... src-group 0x1 dst-group 0x2
... src-group 0x2 dst-group 0x1

After:
------
... src-group grp1 dst-group grp2
... src-group grp2 dst-group grp1

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
extensions/libipt_realm.c
extensions/libxt_devgroup.c