]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r338047:
authorcy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)
committercy <cy@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)
commit67aa3ef0d82806304a85239b7b8de205dce6c6cd
treeeacfba49c15db7307f88879200934d271e85cad5
parentf755fe0974d622b8141afc5bbd637003439137c1
MFC r338047:

The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

git-svn-id: svn://svn.freebsd.org/base/stable/10@338171 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/contrib/ipfilter/netinet/ip_nat.c