Commit Graph

16 Commits

Author SHA1 Message Date
Terry Wilson
5dd7370c32 Fix possible error on stringification of IPv4-mapped addrs
The FreeBSD netsock2 test has been failing for a while. We were
pasing sa->len to getnameinfo instead of sa_tmp->len.

ASTERISK-18289


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-18 21:26:01 +00:00
Terry Wilson
0ada0bfea3 Stop sending IPv6 link-local scope-ids in SIP messages
The idea behind the patch listed below was used, but in a more targeted manner.
There are now address stringification functions for addresses that are meant to
be sent to a remote party. Link-local scope-ids only make sense on the machine
from which they originate and so are stripped in the new functions.

There is also a host sanitization function added to chan_sip which is used
for when peer and dialog tohost fields or sip_registry hostnames are used to
craft a SIP message.

Also added are some basic unit tests for netsock2 address parsing.

(closes issue ASTERISK-17711)
Reported by: ch_djalel
Patches:
      asterisk-1.8.3.2-ipv6_ll_scope.patch uploaded by ch_djalel (license 1251)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-22 18:52:04 +00:00
Richard Mudgett
0fe02d0183 Made ast_sockaddr_split_hostport() port warning msgs more meaningful.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 17:21:39 +00:00
Mark Murawki
d21c41b26a ast_sockaddr_resolve() in netsock2.c may deref a null pointer
Added a null check in netsock2 ast_sockaddr_resolve() as well as added default initalizers in chan_sip parse_uri_legacy_check() to make sure that invalid uris will make null (and not undefined) user,pass,domain,transport variables

(closes issue #19346)
Reported by: kobaz
Patches: 
      netsock2.patch uploaded by kobaz (license 834)
Tested by: kobaz, Marquis



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@321100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-26 20:09:35 +00:00
Russell Bryant
f10b21bd24 Resolve some compiler errors in ast_sockaddr_is_any().
These errors came up once this function was used from within netsock2.c.
The errors were like the following:

netsock2.c:393: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules

The usage of a union here avoids this problem.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:50:04 +00:00
David Vossel
64a0eebfa3 Fixes build error for systems not supporting IPV6_TCLASS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:16:00 +00:00
David Vossel
df369754da Fixes qos settings for sockets bound to any IPv6 or IPv4 address.
(closes issue #18099)
Reported by: jamesnet
Patches:
      issues_18099_v3.diff uploaded by dvossel (license 671 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 16:02:17 +00:00
David Vossel
e735b3f28c Set TCLASS field of IPv6 header when sip qos options are set.
(closes issue #18099)
Reported by: jamesnet
Patches:
      issues_18099_v2.diff uploaded by dvossel (license 671)
Tested by: dvossel, jamesnet


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 22:09:32 +00:00
Tilghman Lesher
c20e1d3f3f Only output debugging if the debug level is on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@282826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-19 14:44:51 +00:00
5c1c1b35bd Fix parsing of IPv6 address literals in outboundproxy
(closes issue #17757)
Reported by: oej
Patches:
      17757.diff uploaded by sperreault (license 252)
      sip.conf.diff uploaded by sperreault (license 252)
Tested by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-11 13:30:59 +00:00
David Vossel
ab374d0446 fix sip transaction match with authentication, fix confusing log message when using getaddrinfo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-27 16:09:15 +00:00
Mark Michelson
6fa79e8f77 Make ACLs IPv6-capable.
ACLs can now be configured to match IPv6 networks. This is only
relevant for ACLs in chan_sip for now since other channel drivers
do not support IPv6 addressing. However, once those channel drivers
are outfitted to support IPv6 addressing, the ACLs will already be
ready for IPv6 support.

https://reviewboard.asterisk.org/r/791



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19 14:17:16 +00:00
Mark Michelson
b1b29e5214 Allow netsock2.c to compile on systems that do not define AI_NUMERICSERV.
(closes issue #17617)
Reported by: pprindeville
Patches: 
      asterisk-trunk-bugid17617.patch uploaded by pprindeville (license 347)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-12 14:55:23 +00:00
Tilghman Lesher
da8450323f Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 17:00:22 +00:00
21dc81bb31 Sadly we can't dereference a pointer cast and use it as an lvalue without getting this
warning (at least with gcc 4.4.4):

netsock2.c:492: warning: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules

So we're back to using memcpy()...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 12:56:18 +00:00
Mark Michelson
cd4ebd336f Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses
within Asterisk. While many files have been updated to make use of the
API, chan_sip and the RTP code are the files which actually support
IPv6 addresses at the time of this commit. The way has been paved for
easier upgrading for other files in the near future, though.

Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne
for their hard work on this.

(closes issue #17565)
Reported by: russell
Patches: 
      asteriskv6-test-report.pdf uploaded by russell (license 2)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 22:08:07 +00:00