Make contactdeny apply to src ip when nat=yes
authorTerry Wilson <twilson@digium.com>
Tue, 15 Jun 2010 20:18:04 +0000 (20:18 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 15 Jun 2010 20:18:04 +0000 (20:18 +0000)
commit480f4128588f1797aeed722bbf52ee2d82ff22ae
tree542dc78c014bd82d619f0174539a63601d8cea2e
parent7037dd668013399920f9f623bd4cfdcee3b043a9
Make contactdeny apply to src ip when nat=yes

chan_sip's "contactdeny" feature screens the "to be registered contact".
In case of nat=yes it should not use the address information from the
Contact header (which is not used at all for routing), but the source
IP address of the request.

Thus, if nat=yes and a client sends a request from a denied IP address
(e.g. by spoofing the src-IP address) it can bypass the screening.

This commit makes contactdeny apply to the src ip when nat=yes instead.

(closes issue #17276)
Reported by: klaus3000
Patches:
      patch-asterisk-trunk-contactdeny.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c