Discussion:
Adding accounting object via libiptc
Sourabh Nanoti
2014-08-19 10:06:27 UTC
Permalink
Hello,
I wanted to add a nfacct object to an iptable rule. Catch is I am
trying to add the rule via libiptc.
Following is the code snippet for the ipt_entry_match:

matchnfacct = (struct ipt_entry_match *) (e->elems) ;
matchnfacct->u.match_size = size;
strcpy(matchstr->u.user.name, "nfacct");

nfacct_info = (struct xt_nfacct_match_info *)matchnfacct->data;
strcpy(nfacct_info->name,"accobj1");

I have created the accounting object 'accobj1' prior to inserting the
iptable rule.

My program fails with the following error :
'commit error: Invalid argument'

Without the accounting object, I am able to insert rules without any problem.

What is it that I am missing?

Thanks in advance for the help.
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...