[NETFILTER]: Simplify expect handling
Now we've changed expect handling, we can simplify it significantly. 1) struct ip_conntrack_expect only exists until the connection matching it is created. Now NAT is done directly at the time the expectation is matched, we don't need to keep this information around. 2) The term 'master' is used everywhere to mean the connection that expected this connection. The 'master' field in the new connection points straight to the master connection, and holds a reference. 3) There is no direct link from the connection to the expectations it has created: we walk the global list to find them if we need to clean them up. Each expectation holds a reference. 4) The ip_conntrack_expect_tuple_lock is now a proper subset of ip_conntrack_lock, so we can eliminate it. 5) Remove flags from helper: the policy of evicting the oldest expectation seems to be appropriate for everyone. 6) ip_conntrack_expect_find_get() and ip_conntrack_expect_put() are no longer required. 7) Remove reference count from expectations, and don't free when we fail ip_conntrack_expect_related(): have user call ip_conntrack_expect_free(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing
This diff is collapsed.
Please register or sign in to comment