Module Name: src Committed By: christos Date: Sat Jan 5 16:34:43 UTC 2013
Modified Files: src/sys/external/bsd/ipf/netinet: ip_nat.c ip_nat.h Log Message: Fix bucket and chain counts on nat lists from Geoff Adams: The problem was that ipf_nat_delete wasn't swapping inbound and outbound hash codes for inbound NAT entries, so it was essentially always looking in the wrong buckets in those cases. But because of the way the linked list works, I don't think any NAT entries were actually leaked. But since all the bucket counters and chain count were getting messed up, things did start to go bad after a while. (New NAT entries wouldn't be created, for instance.) The fix is in the ipf_nat_delete function, itself; the other changes are a slight refactoring of one method and adding some comments that helped me figure out how the linked list with pointer-back-pointers worked. Also note that I haven't looked through the logic in ipf_nat_rehash; it's likely that that might miss some things for the same reason. I also haven't yet looked into the ipf_nat_newrdr problem with mappings already existing. That'll be next. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/ipf/netinet/ip_nat.c cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/ipf/netinet/ip_nat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.