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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@344216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2011-11-09 20:07:34 +00:00
parent 4067667855
commit 11a6abe970
4 changed files with 139 additions and 114 deletions

View File

@@ -1758,7 +1758,7 @@ struct contact {
char *name;
char *user;
char *pass;
char *domain;
char *hostport;
struct uriparams params;
char *headers;
char *expires;