Connection Tracking
Hello everyone,
I would be grateful for some advice. Am writing a target using xtables. This target saves and restores a field in the IPv{4,6} header to/from the connection mark.
I have read Jan Engelhardt's booklet (3 July 2012), but remain unclear on how to ensure that connection tracking is turned on.
My difficulty arises in the following code snippet:
const struct nf_conn *ct;
ct = nf_ct_get(skb, &ctinfo);
if (ct == NULL) {
return false;
}
/* use ct-> */ct is always false and therefore I cannot do the save and restore.
Any suggestions?
Many thanks
Nicole
Quoted 18 lines · Nicole
Hello everyone,
I would be grateful for some advice. Am writing a target using xtables. This target saves and restores a field in the IPv{4,6} header to/from the connection mark.
I have read Jan Engelhardt's booklet (3 July 2012), but remain unclear on how to ensure that connection tracking is turned on.
My difficulty arises in the following code snippet:
const struct nf_conn *ct; ct = nf_ct_get(skb, &ctinfo); if (ct == NULL) { return false; } /* use ct-> */
Quoted 3 lines
ct is always false and therefore I cannot do the save and restore.
Any suggestions?
Make sure nf_conntrack and nf_conntrack_ipv4 are loaded.