On Thu, Dec 04, 2003 at 12:42:14PM +0800, Jesse Peng wrote:
According to above, this circumstance only limited at POST_ROUTING hook,
then the question is as follow:
1.Since ip_nat_fn is called both during PREROUTING and POSTROUTING hook,
then we've sure while a new packet passing PREROUTING, the ip_nat_fn
have called ip_nat_rule_find, then the ip_nat_rule_find graranting that
even no rule found the output tuple will be unique(through the
compensation by allocate_null_biding).
2.While during POSTROUTE, the input tuple: orig_tuple to
get_unique_tuple is right one the output tuple above mentioned, so it is
still unique!!
3.Then why can't we just check if the src of the orig_tuple "in range"
the mr. If it is, then all we need to do is to set the
*tuple=*orig_tuple, and return 1.
so what about the cases where we have packets originated by the local
machine? They will appear via ip_nat_local_fn() -> ip_nat_fn() ->
ip_nat_rule_find() attached to LOCAL_OUT only if CONFIG_IP_NF_NAT_LOCAL
is defined.
If not, the packet is actually only seen at POST_ROUTING, and we still
have to make sure the tuple is unique.
1.If the above is true, so the purpose of hash_by_src is only designed for
local generated packets on the condition with the