Changeset 925ae60


Ignore:
Timestamp:
01/13/15 15:44:02 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
b73407f
Parents:
4cc6e74
Message:

Fix rare threading bug in traceanon encryption by moving all globals in the library to TLS storage.
This doesn't seem to degrade performance and keeps DRD (valgrind) happy.

Location:
tools/traceanon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/ipenc.c

    ra8f2692 r925ae60  
    1919#endif
    2020
    21 static enum enc_type_t enc_type = ENC_NONE;
     21static __thread enum enc_type_t enc_type = ENC_NONE;
    2222
    2323static uint32_t masks[33] = {
     
    3131};
    3232
    33 static uint32_t prefix;
    34 static uint32_t netmask;
     33static __thread uint32_t prefix;
     34static __thread uint32_t netmask;
    3535static void init_prefix(const char *key)
    3636{
  • tools/traceanon/rijndael.c

    rc0a5a50 r925ae60  
    5050#include <string.h>
    5151
    52 static State     m_state;
    53 static Mode      m_mode;
    54 static Direction m_direction;
    55 static UINT8     m_initVector[MAX_IV_SIZE];
    56 static UINT32    m_uRounds;
    57 static UINT8     m_expandedKey[_MAX_ROUNDS+1][4][4];
    58 
     52static __thread State     m_state;
     53static __thread Mode      m_mode;
     54static __thread Direction m_direction;
     55static __thread UINT8     m_initVector[MAX_IV_SIZE];
     56static __thread UINT32    m_uRounds;
     57static __thread UINT8     m_expandedKey[_MAX_ROUNDS+1][4][4];
    5958
    6059static UINT8 S[256]=
Note: See TracChangeset for help on using the changeset viewer.