|
@@ -55,6 +55,7 @@ static int dumped;
|
55
|
55
|
int table_init(const char *table, iptc_handle_t *t)
|
56
|
56
|
{
|
57
|
57
|
*t=iptc_init(table);
|
|
58
|
+ error("In table_int, t: %s and errno %d", table,errno);
|
58
|
59
|
if (!(*t)) {
|
59
|
60
|
error("In table_init, table %s: -> %s", table,iptc_strerror(errno));
|
60
|
61
|
err_ret(ERR_NETFIL,-1);
|
|
@@ -73,6 +74,7 @@ int insert_rule(const char *rule,iptc_handle_t *t,const char *chain,int pos)
|
73
|
74
|
{
|
74
|
75
|
int res;
|
75
|
76
|
res=iptc_insert_entry(chain,(struct ipt_entry*)rule,0,t);
|
|
77
|
+ error("res is: %d rule is: %p chain is: %s pos is: %d t is: %p errno is: %d", res, rule, chain, pos, t, errno);
|
76
|
78
|
if (!res) {
|
77
|
79
|
error("In insert_rule: %s.",iptc_strerror(errno));
|
78
|
80
|
err_ret(ERR_NETRUL,-1);
|
|
@@ -89,6 +91,7 @@ int append_rule(const char *rule,iptc_handle_t *t,const char *chain)
|
89
|
91
|
{
|
90
|
92
|
int res;
|
91
|
93
|
res=iptc_append_entry(chain,(struct ipt_entry*)rule,t);
|
|
94
|
+ error("res is: %d, chain: %s, rule: %s, t: %s, Errno is: %d",res,chain,rule,t,errno);
|
92
|
95
|
if (!res) {
|
93
|
96
|
error("In append_rule: %s.",iptc_strerror(errno));
|
94
|
97
|
err_ret(ERR_NETRUL,-1);
|
|
@@ -105,7 +108,7 @@ int commit_rules(iptc_handle_t *t)
|
105
|
108
|
{
|
106
|
109
|
int res;
|
107
|
110
|
res=iptc_commit(t);
|
108
|
|
- error("This is the value of res: %i This is the value of t is: %p", res, t);
|
|
111
|
+ error("This is the value of res: %i This is the value of t is: %p errno is: %d", res, t, errno);
|
109
|
112
|
if (!res) {
|
110
|
113
|
error("In commit_rules: %s.",iptc_strerror(errno));
|
111
|
114
|
err_ret(ERR_NETCOM,-1);
|
|
@@ -321,11 +324,13 @@ int store_rules()
|
321
|
324
|
dr.sz=IGW_FILTER_RULE_SZ;
|
322
|
325
|
memcpy(dr.e,d,dr.sz);
|
323
|
326
|
dr.chain=CHAIN_PREROUTING;
|
324
|
|
- commit_rules(&t);
|
|
327
|
+ error("This is store_rules, And the value of t is: %p", t);
|
|
328
|
+ commit_rules(&t);
|
325
|
329
|
return 0;
|
326
|
330
|
}
|
327
|
331
|
else {
|
328
|
|
- error("This is store_rules, And the value of t is: %p", t);
|
|
332
|
+
|
|
333
|
+ error("This is store_rules else, And the value of t is: %p", t);
|
329
|
334
|
commit_rules(&t);
|
330
|
335
|
error("In store_rules: %s.",iptc_strerror(errno));
|
331
|
336
|
err_ret(ERR_NETSTO,-1);
|