intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
289 stars 87 forks source link

uint128_t definition in /usr/include/intel-ipsec-mb.h clashes with /usr/include/bluetooth/bluetooth.h #41

Closed ColinIanKing closed 4 years ago

ColinIanKing commented 4 years ago

In /usr/include/intel-ipsec-mb.h uint128_t is defined as:

/* 128-bit data type that is not in sdtint.h */
typedef struct {
        uint64_t low;
        uint64_t high;
} uint128_t;

However, this clashes with other definitions of uint128_t such as the one in /usr/include/bluetooth/bluetooth.h, e.g:

typedef struct {
        uint8_t data[16];
} uint128_t;

This causes conflict when including these two header files. Since uint128_t may in the future clash with an ISO C uint128_t native type it maybe better to rename the uint128_t in intel-ipsec-mb.h so it won't clash. Perhaps something like __ipsec_uint128_t

Otherwise we get build failures such as:

/usr/include/bluetooth/bluetooth.h:345:3: error: conflicting types for ‘uint128_t’
  345 | } uint128_t;
      |   ^~~~~~~~~
In file included from stress-ng.h:131,
                 from stress-l2cap.c:25:
/usr/include/intel-ipsec-mb.h:42:3: note: previous declaration of ‘uint128_t’ was here
   42 | } uint128_t;
      |   ^~~~~~~~~
tkanteck commented 4 years ago

Thanks Colin - we'll look into it

ColinIanKing commented 4 years ago

Thanks for fixing this, much appreciated!