Skip to contentSkip to conversation

code to display contents for iptables -L not getting invoked | Its a test module

DISCUSSION Balaji Venkatamohan 2 participants 2 messages Feb 11, 2010 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

I developed a match extension and successfully compiled the code into the extensions directory. I was also able to insert the desired rule and got the expected performance/output. Everything seems to work fine except that when I issue iptables -L, it shows under the desired chain that a rule is present but it doesn't print the contents under the function _mt_print() function of libxt_*.c file. I am getting the message that 'unknown match <matchname>'.

Can anyone tell me where I am going wrong?

Thanks and Regards,
Balaji Venkatamohan

#1 lore raw
Quoted 10 lines · Balaji Venkatamohan

I developed a match extension and successfully compiled the code into the extensions directory. I was also able to insert the desired rule and got the expected performance/output. Everything seems to work fine except that when I issue iptables -L, it shows under the desired chain that a rule is present but it doesn't print the contents under the function _mt_print() function of libxt_*.c file. I am getting the message that 'unknown match <matchname>'.

Can anyone tell me where I am going wrong?

Is it perhaps possible that you called iptables -L without making available the location of your module? (in case it's not in the standard search patch) If you only compiled Xt-a, but not install anything, then something like

XTABLES_LIBDIR=$my/extensions:$standardpath iptables {-A|-L} ...

is needed. This needs to be present at both insert time as well as when you run with -L.

The standard path depends on distro, each seems to want to roll their own cookiecoloring (/usr/libexec/iptables, /usr/lib64/iptables, /lib64/iptables are some examples...)