how to get consistent value of "nf_conntrack_htable_size" and "nf_conntrack_hash" in a kernel module ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I want to foreach all the `struct nf_conn's in my out-of-tree kernel module.

My plan is to get the `nf_conntrack_htable_size' and `nf_conntrack_hash', then do some read on the hash table.

However, the symbol `nf_conntrack_generation' is not exported, so I cannot do things like this:

struct hlist_nulls_head *hptr;
unsigned int sequence, hsz;

do {
    sequence = read_seqcount_begin(&nf_conntrack_generation);
    hsz = nf_conntrack_htable_size;
    hptr = nf_conntrack_hash;
} while (read_seqcount_retry(&nf_conntrack_generation, sequence));


How to get a consistent value of `nf_conntrack_htable_size' and `nf_conntrack_hash' ?


Thanks.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux