Don't treat a host:port string as a domain
authorTerry Wilson <twilson@digium.com>
Wed, 9 Nov 2011 20:10:52 +0000 (20:10 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 9 Nov 2011 20:10:52 +0000 (20:10 +0000)
commit04f04ff39d8067c836c0a19120113ab1c210a5ae
treeb8a2b47a243cca7aad059be84f0641fd6950ae43
parentfa57bbe17cac2deaad8d7ff0a9265fd3883341ae
Don't treat a host:port string as a domain

The domain matching code prior to 1.8 used to manually remove the port
from the host:port string when determining if an incoming request
matched the list of domains. When switching to the new parsing
functions, the documentation implied that the "domain" was being
returned by these functions, when instead it was returning the
"hostport" as defined by RFC 3261. This led to confusion and resulted
in 1.8+ rejecting an incoming request from x.x.x.x:xxxxx when
domain=x.x.x.x was set in sip.conf.

This patch renames the "domain" variables in the parsing functions to
"hostport" to more accurately describe what it is that they are
returning and also properly truncates the resulting hostport strings
when dealing with domain matching.

Review: https://reviewboard.asterisk.org/r/1574/
........

Merged revisions 344215 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344216 from http://svn.asterisk.org/svn/asterisk/branches/10

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