diff options
author | Simone Mainardi <simonemainardi@gmail.com> | 2016-07-08 15:10:33 +0200 |
---|---|---|
committer | Simone Mainardi <simonemainardi@gmail.com> | 2016-07-08 15:23:45 +0200 |
commit | 72e3930e088c9e6df51f7f314935167c63b8d0ad (patch) | |
tree | c94af77134d6de80ad01a0fcc5f988ace24c4392 /src/lib/protocols/rx.c | |
parent | 6fb81f146e2542cfbf7fab7d53678339c7747b35 (diff) | |
parent | 31140c8da74aaceb76709c11082e4cb2e07e11e9 (diff) |
Fixes nDPI protocol initialization for Git
[NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized
This is actually a merge of branch 'dev' into 1.8-stable.
Diffstat (limited to 'src/lib/protocols/rx.c')
-rw-r--r-- | src/lib/protocols/rx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/protocols/rx.c b/src/lib/protocols/rx.c index 319dd6d4d..9d27d5e18 100644 --- a/src/lib/protocols/rx.c +++ b/src/lib/protocols/rx.c @@ -30,7 +30,8 @@ /* See http://web.mit.edu/kolya/afs/rx/rx-spec for procotol description. */ /* The should be no need for explicit packing, but just in case... */ -struct __attribute__((__packed__)) ndpi_rx_header { +PACK_ON +struct ndpi_rx_header { u_int32_t conn_epoch; u_int32_t conn_id; u_int32_t call_number; @@ -42,7 +43,7 @@ struct __attribute__((__packed__)) ndpi_rx_header { u_int8_t security; u_int16_t checksum; u_int16_t service_id; -}; +} PACK_OFF; /* Type values */ #define DATA 1 @@ -108,7 +109,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct, **/ /* TYPE field */ - if((header->type < DATA) && (header->type > VERSION)) { + if((header->type < DATA) || (header->type > VERSION)) { NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX); return; @@ -170,8 +171,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct, security: /* SECURITY field */ - if(header->security != 0 && header->security != 1 && - header->security != 2 && header->security != 3) + if(header->security > 3) { NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX); |