ctnetlink NATINFO notification
Hi,
While hacking on ct_sync, I've found a suspicious code fragment inip_nat_core.c with the ctnetlink patch applied. At the end of ip_nat_setup_info(), an event is generated that the NAT information was changed:
[...] IP_NAT_MANIP_SRC, inv_tuple.src }); IP_NF_ASSERT(info->num_manips <= IP_NAT_MAX_MANIPS); }
ip_conntrack_event(IPCT_NATINFO, conntrack);
/* If there's a helper, assign it; based on new tuple. */ if (!conntrack->master)
info->helper = LIST_FIND(&ip_nat_helpers, helper_cmp, struct ip_nat_helper *, &reply);
/* It's done. */info->initialized |= (1 << HOOK2MANIP(hooknum));
However, as you can see, the event is generated even before updating
the initialized field of the NAT info structure of the conntrack, so that when the notifier functions are called, the conntrack isn't fully up-to-date yet. Wouldn't be better to call the nofifiers right before the return statement?
Signature · 2 lines
Regards, Krisztian KOVACS