[NETFILTER]: Fix find_appropriate_src() to actually work.
We try to bind to the same source port when sending packets from the same source IP/source port to the outside world. Normally, this is simple, since we always try to keep the same source port anyway, but there are cases where that is not available. This is a requirement for the Kegel Peer-to-Peer NAT paper: http://alumnus.caltech.edu/~dank/peer-nat.html Unfortunately, our current implementation is useless. It looks up a hash to see if this srcip/srcpt has been used, but instead of returning the mapping to use, it simply returns that same srcip/srcpt. This is clearly wrong. As pointed out by Krisztian Kovacs. Also, we are no longer using the netfilter-special list iterators, so we can split src_cmp, in_range and the actual result manipulation for much clearer code. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing
Please register or sign in to comment