Commit Graph

26 Commits

Author SHA1 Message Date
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Richard Mudgett c41dd32b94 Audit ast_sockaddr_resolve() usage for memory leaks.
Valgrind found some memory leaks associated with ast_sockaddr_resolve().
Most of the leaks had already been fixed by earlier memory leak hunt
patches.  This patch performs an audit of ast_sockaddr_resolve() and found
one more.

* Fix ast_sockaddr_resolve() memory leak in
apps/app_externalivr.c:app_exec().

* Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
parameter for safety so the pointer will never be uninitialized on return.
The same goes for res/res_pjsip_acl.c:extract_contact_addr().

* Made functions that call ast_sockaddr_resolve() with RAII_VAR()
controlling the addrs variable use ast_free instead of ast_free_ptr to
provide better MALLOC_DEBUG information.

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

Merged revisions 433056 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433057 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-17 21:52:47 +00:00
George Joseph d87f8c429e pjsip cli: Change Identify to show CIDR notation instead of netmasks.
* Added ast_sockaddr_cidr_bits() to count the 1 bits in an ast_sockaddr.
* Added ast_ha_join_cidr() which uses ast_sockaddr_cidr_bits() for the netmask
  instead of ast_sockaddr_stringify_addr.
* Changed res_pjsip_endpoint_identifier_ip to call ast_ha_join_cidr() instead
  of ast_ha_join() for the CLI output.

This is a CLI change only.  AMI was not affected.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3652/
........

Merged revisions 416737 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19 20:13:20 +00:00
Jonathan Rose e81b873fa2 chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'
ASTERISK-23564 #close
Reported by: Patrick Laimbock
Review: https://reviewboard.asterisk.org/r/3474/
........

Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413877 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 18:09:13 +00:00
Michael L. Young 2af53640c8 Add IPv6 Support To chan_iax2
This patch adds IPv6 support to chan_iax2.  Yay!

(closes issue ASTERISK-22025)
Patches:
  iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026)

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

Merged revisions 400567 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 21:41:58 +00:00
Michael L. Young c843dddf80 Fix NULL pointer segfault in ast_sockaddr_parse()
While working with ast_parse_arg() to perform a validity check, a segfault
occurred.  The segfault occurred due to passing a NULL pointer to
ast_sockaddr_parse() from ast_parse_arg().  According to the documentation in
config.h, "result pointer to the result.  NULL is valid here, and can be used to
perform only the validity checks."

This patch fixes the segfault by checking for a NULL pointer.  This patch also
adds documentation to netsock2.h about why it is necessary to check for a NULL
pointer.

(Closes issue ASTERISK-20006)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
asterisk-20006-netsock-null-ptr.diff uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-20 02:07:00 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
Terry Wilson d2af16a86c Merged revisions 332560 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r332560 | twilson | 2011-08-18 16:34:04 -0500 (Thu, 18 Aug 2011) | 12 lines
  
  Merged revisions 332559 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r332559 | twilson | 2011-08-18 16:26:01 -0500 (Thu, 18 Aug 2011) | 5 lines
    
    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/trunk@332561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-18 21:39:04 +00:00
Terry Wilson 385b8c6f8b Merged revisions 324484 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324484 | twilson | 2011-06-22 13:52:04 -0500 (Wed, 22 Jun 2011) | 20 lines
  
  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/trunk@324487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-22 19:12:24 +00:00
Richard Mudgett 9ff8844c7f Merged revisions 323392,323394 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r323392 | rmudgett | 2011-06-14 12:21:24 -0500 (Tue, 14 Jun 2011) | 6 lines
  
  Add more strict hostname checking to ast_dnsmgr_lookup().
  
  Change suggested in review.
  
  Review: https://reviewboard.asterisk.org/r/1240/
........
  r323394 | rmudgett | 2011-06-14 12:21:39 -0500 (Tue, 14 Jun 2011) | 2 lines
  
  Made ast_sockaddr_split_hostport() port warning msgs more meaningful.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 17:22:26 +00:00
Mark Murawki 0648d9595b Merged revisions 321100 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321100 | markm | 2011-05-26 16:09:35 -0400 (Thu, 26 May 2011) | 11 lines
  
  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/trunk@321101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-26 20:16:28 +00:00
Matthew Nicholson 48a9694ed0 Merged revisions 304245 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r304245 | mnicholson | 2011-01-26 14:43:27 -0600 (Wed, 26 Jan 2011) | 20 lines
  
  Merged revisions 304244 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r304244 | mnicholson | 2011-01-26 14:42:16 -0600 (Wed, 26 Jan 2011) | 13 lines
    
    Merged revisions 304241 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r304241 | mnicholson | 2011-01-26 14:38:22 -0600 (Wed, 26 Jan 2011) | 6 lines
      
      This patch modifies chan_sip to route responses to the address the request came from.  It also modifies chan_sip to respect the maddr parameter in the Via header.
      
      ABE-2664
      
      Review: https://reviewboard.asterisk.org/r/1059/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-26 20:44:47 +00:00
Russell Bryant 84cbd3249a Merged revisions 292188 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292188 | russell | 2010-10-18 14:50:04 -0500 (Mon, 18 Oct 2010) | 9 lines
  
  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/trunk@292189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:52:58 +00:00
David Vossel 6a09c24bae Merged revisions 292155 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292155 | dvossel | 2010-10-18 14:16:00 -0500 (Mon, 18 Oct 2010) | 2 lines
  
  Fixes build error for systems not supporting IPV6_TCLASS.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:16:48 +00:00
David Vossel c908c4cc34 Merged revisions 292085 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292085 | dvossel | 2010-10-18 11:02:17 -0500 (Mon, 18 Oct 2010) | 7 lines
  
  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/trunk@292086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 16:03:24 +00:00
David Vossel dc0b76c04c Merged revisions 291829 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r291829 | dvossel | 2010-10-14 17:09:32 -0500 (Thu, 14 Oct 2010) | 8 lines
  
  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/trunk@291830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 22:10:20 +00:00
Tilghman Lesher 757ad05187 Merged revisions 282826 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r282826 | tilghman | 2010-08-19 09:44:51 -0500 (Thu, 19 Aug 2010) | 2 lines
  
  Only output debugging if the debug level is on.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@282827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-19 14:46:08 +00:00
a491cac965 Merged revisions 281687 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r281687 | simon.perreault | 2010-08-11 09:30:59 -0400 (Wed, 11 Aug 2010) | 9 lines
  
  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/trunk@281688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-11 13:31:39 +00:00
David Vossel d61a4088f5 Merged revisions 279817 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r279817 | dvossel | 2010-07-27 11:09:15 -0500 (Tue, 27 Jul 2010) | 2 lines
  
  fix sip transaction match with authentication, fix confusing log message when using getaddrinfo
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-27 16:11:11 +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