Mailing List Archive

Initialization of local variable in a iptables datastructure
I have introduced a variable in xt_counters data structure of type
uint_64t to be used as a counter in ipt_entry data structure. I have
installed iptable new version source code from its website. In this
userspace, I am printing the variable with other packet and byte
counters. Till now iptables are working fine and every thing is all
right -- except with the problem that the variable which I introduced
is showing garbage values mostly 0's ( when print several times with
iptables -L command). I have initialized the variable on the location
where its required but I am not getting a constant value which is in my
case should be only 0 (during testing). Can any one puts a light on
this. I didnt know what the Linux kernel might do if its encounter an
uninitialized variable.

Also since I am printing the counters with the help of iptables-save -c
and iptables -L -n -v and in both cases I am getting this non-obvious
results; there fore I had also tried with initiailizing the variable in
ipt_do_table function under the do_while loop and make the variable
initialized always to 0, but this also not useful as I am still viewing
the same results.

Karim Asif Sattar