Skip to content
Snippets Groups Projects
  1. Apr 23, 2015
    • Diederik de Groot's avatar
      Clang: change previous tautological-compare fixes. · ca719316
      Diederik de Groot authored
      clang can warn about a so called tautological-compare, when it finds
      comparisons which are logically always true, and are therefor deemed
      unnecessary.
      
      Exanple:
      unsigned int x = 4;
      if (x > 0)    // x is always going to be bigger than 0
      
      Enum Case:
      Each enumeration is its own type. Enums are an integer type but they
      do not have to be *signed*. C leaves it up to the compiler as an
      implementation option what to consider the integer type of a particu-
      lar enumeration is. Gcc treats an enum without negative values as
      an int while clang treats this enum as an unsigned int.
      
      rmudgett & mmichelson: cast the enum to (unsigned int) in assert.
      The cast does have an effect. For gcc, which seems to treat all enums
      as int, the cast to unsigned int will eliminate the possibility of
      negative values being allowed. For clang, which seems to treat enums
      without any negative members as unsigned int, the cast will have no
      effect. If for some reason in the future a negative value is ever
      added to the enum the assert will still catch the negative value.
      
      ASTERISK-24917
      
      Change-Id: I0557ae0154a0b7de68883848a609309cdf0aee6a
      ca719316
  2. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      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
      4a582616
  3. Apr 09, 2015
    • Matthew Jordan's avatar
      clang compiler warnings: Fix autological comparisons · ea009872
      Matthew Jordan authored
      This fixes autological comparison warnings in the following:
       * chan_skinny: letohl may return a signed or unsigned value, depending on the
         macro chosen
       * func_curl: Provide a specific cast to CURLoption to prevent mismatch
       * cel: Fix enum comparisons where the enum can never be negative
       * enum: Fix comparison of return result of dn_expand, which returns a signed
         int value
       * event: Fix enum comparisons where the enum can never be negative
       * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
         negative
       * presencestate: Use the actual enum value for INVALID state
       * security_events: Fix enum comparisons where the enum can never be negative
       * udptl: Don't bother to check if the return value from encode_length is less
         than 0, as it returns an unsigned int
       * translate: Since the parameters are unsigned int, don't bother checking
         to see if they are negative. The cast to unsigned int would already blow
         past the matrix bounds.
       * res_pjsip_exten_state: Use a temporary value to cache the return of
         ast_hint_presence_state
       * res_stasis_playback: Fix enum comparisons where the enum can never be
         negative
       * res_stasis_recording: Add an enum value for the case where the recording
         operation is in error; fix enum comparisons
       * resource_bridges: Use enum value as opposed to -1
       * resource_channels: Use enum value as opposed to -1
      
      Review: https://reviewboard.asterisk.org/r/4533
      ASTERISK-24917
      Reported by: dkdegroot
      patches:
        rb4533.patch submitted by dkdegroot (License 6600)
      ........
      
      Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ea009872
  4. Mar 28, 2015
  5. Aug 06, 2014
  6. May 09, 2014
  7. Feb 07, 2014
  8. Feb 06, 2014
  9. Dec 19, 2013
  10. Nov 08, 2013
  11. Oct 03, 2013
  12. Aug 17, 2013
    • Kinsey Moore's avatar
      Strip down the old event system · 59753b1e
      Kinsey Moore authored
      This removes unused code, event types, IE pltypes, and event IE types
      where possible and makes several functions private that were once
      public. This includes a renumbering of the remaining event and IE types
      which breaks binary compatibility with previous versions. The last
      remaining consumers of the old event system (or parts thereof) are
      main/security_events.c, res/res_security_log.c, tests/test_cel.c,
      tests/test_event.c, main/cel.c, and the CEL backends.
      
      Review: https://reviewboard.asterisk.org/r/2703/
      (closes issue ASTERISK-22139)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      59753b1e
  13. May 30, 2013
    • David M. Lee's avatar
      Avoid unnecessary cleanups during immediate shutdown · d81c8467
      David M. Lee authored
      This patch addresses issues during immediate shutdowns, where modules
      are not unloaded, but Asterisk atexit handlers are run.
      
      In the typical case, this usually isn't a big deal. But the
      introduction of the Stasis message bus makes it much more likely for
      asynchronous activity to be happening off in some thread during
      shutdown.
      
      During an immediate shutdown, Asterisk skips unloading modules. But
      while it is processing the atexit handlers, there is a window of time
      where some of the core message types have been cleaned up, but the
      message bus is still running. Specifically, it's still running
      module subscriptions that might be using the core message types. If a
      message is received by that subscription in that window, it will
      attempt to use a message type that has been cleaned up.
      
      To solve this problem, this patch introduces ast_register_cleanup().
      This function operates identically to ast_register_atexit(), except
      that cleanup calls are not invoked on an immediate shutdown. All of
      the core message type and topic cleanup was moved from atexit handlers
      to cleanup handlers.
      
      This ensures that core type and topic cleanup only happens if the
      modules that used them are first unloaded.
      
      This patch also changes the ast_assert() when accessing a cleaned up
      or uninitialized message type to an error log message. Message type
      functions are actually NULL safe across the board, so the assert was a
      bit heavy handed. Especially for anyone with DO_CRASH enabled.
      
      Review: https://reviewboard.asterisk.org/r/2562/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      d81c8467
  14. May 17, 2013
  15. Nov 19, 2012
  16. Jun 15, 2012
    • Kevin P. Fleming's avatar
      Multiple revisions 369001-369002 · 166b4e2b
      Kevin P. Fleming authored
      ........
        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
      166b4e2b
  17. Apr 16, 2012
    • Michael L. Young's avatar
      Add IPv6 address support to security events framework. · abf40d9b
      Michael L. Young authored
      The current Security Events Framework API only supports IPv4 when it comes to
      generating security events.  This patch does the following:
      
      * Changes the Security Events Framework API to support IPV6 and updates
        the components that use this API.
      
      * Eliminates an error message that was being generated since the current
        implementation was treating an IPv6 socket address as if it was IPv4.
      
      * Some copyright dates were updated on files touched by this patch.
      
      (closes issue ASTERISK-19447) 
      Reported by: Michael L. Young 
      Tested by: Michael L. Young 
      Patches: 
        security_events_ipv6v3.diff uploaded by Michael L. Young (license 5026)
      
      Review: https://reviewboard.asterisk.org/r/1777/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      abf40d9b
  18. Sep 22, 2011
  19. Jul 11, 2009
    • Russell Bryant's avatar
      Add an API for reporting security events, and a security event logging module. · 4cf8a968
      Russell Bryant authored
      This commit introduces the security events API.  This API is to be used by
      Asterisk components to report events that have security implications.
      A simple example is when a connection is made but fails authentication.  These
      events can be used by external tools manipulate firewall rules or something
      similar after detecting unusual activity based on security events.
      
      Inside of Asterisk, the events go through the ast_event API.  This means that
      they have a binary encoding, and it is easy to write code to subscribe to these
      events and do something with them.
      
      One module is provided that is a subscriber to these events - res_security_log.
      This module turns security events into a parseable text format and sends them
      to the "security" logger level.  Using logger.conf, these log entries may be
      sent to a file, or to syslog.
      
      One service, AMI, has been fully updated for reporting security events.
      AMI was chosen as it was a fairly straight forward service to convert.
      The next target will be chan_sip.  That will be more complicated and will
      be done as its own project as the next phase of security events work.
      
      For more information on the security events framework, see the documentation
      generated from doc/tex/.  "make asterisk.pdf"
      
      Review: https://reviewboard.asterisk.org/r/273/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      4cf8a968
Loading