]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r338047:
authorcy <cy@FreeBSD.org>
Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)
committercy <cy@FreeBSD.org>
Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)
commit32d6dc51da95caf862cb415fd8e045763b7959e0
treee8585a46a149cc2c2e12af1ceff9620f29589882
parenta6a6961a6a7991d8b02946636483ebbd830e96ad
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
sys/contrib/ipfilter/netinet/ip_nat.c