summaryrefslogtreecommitdiff
path: root/channels/sip/include
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2011-11-09 20:10:52 +0000
committerTerry Wilson <twilson@digium.com>2011-11-09 20:10:52 +0000
commit04f04ff39d8067c836c0a19120113ab1c210a5ae (patch)
treeb8a2b47a243cca7aad059be84f0641fd6950ae43 /channels/sip/include
parentfa57bbe17cac2deaad8d7ff0a9265fd3883341ae (diff)
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
Diffstat (limited to 'channels/sip/include')
-rw-r--r--channels/sip/include/reqresp_parser.h4
-rw-r--r--channels/sip/include/sip.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/channels/sip/include/reqresp_parser.h b/channels/sip/include/reqresp_parser.h
index bb1831431..f0ab86e38 100644
--- a/channels/sip/include/reqresp_parser.h
+++ b/channels/sip/include/reqresp_parser.h
@@ -43,7 +43,7 @@
* \endverbatim
*/
int parse_uri(char *uri, const char *scheme, char **ret_name, char **pass,
- char **domain, char **transport);
+ char **hostport, char **transport);
/*!
* \brief parses a URI in to all of its components and any trailing residue
@@ -53,7 +53,7 @@ int parse_uri(char *uri, const char *scheme, char **ret_name, char **pass,
*
*/
int parse_uri_full(char *uri, const char *scheme, char **user, char **pass,
- char **domain, struct uriparams *params, char **headers,
+ char **hostport, struct uriparams *params, char **headers,
char **residue);
/*!
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 0a776ad8a..c3c7a98d5 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -1761,7 +1761,7 @@ struct contact {
char *name;
char *user;
char *pass;
- char *domain;
+ char *hostport;
struct uriparams params;
char *headers;
char *expires;