diff options
author | Luca Deri <deri@ntop.org> | 2023-08-01 15:35:33 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-08-01 15:35:33 +0200 |
commit | 196395398ebdeb47e0da102f7bb489b355f63ae2 (patch) | |
tree | c9ce68bbf6d090b6379c5c184d7a1177ac974ac9 /src/lib/protocols | |
parent | e4d3d619bc9fa2e38521b7ced17f4e7aa633d812 (diff) |
Compilation fixes for older C compilers
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/slp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/protocols/slp.c b/src/lib/protocols/slp.c index bf8f31d6b..02ee71f16 100644 --- a/src/lib/protocols/slp.c +++ b/src/lib/protocols/slp.c @@ -144,6 +144,7 @@ static int slp_dissect_url_entries(struct ndpi_detection_module_struct *ndpi_str struct ndpi_packet_struct const * const packet = &ndpi_struct->packet; struct slp_url_entry const *url_entry; uint16_t url_entries_count; + size_t i; if (packet->payload_packet_len <= url_entries_offset + sizeof(uint16_t)) { return 1; @@ -151,7 +152,7 @@ static int slp_dissect_url_entries(struct ndpi_detection_module_struct *ndpi_str url_entries_count = ntohs(*(uint16_t *)&packet->payload[url_entries_offset]); url_entries_offset += sizeof(uint16_t); - for (size_t i = 0; i < ndpi_min(url_entries_count, NDPI_ARRAY_LENGTH(flow->protos.slp.url)); ++i) { + for (i = 0; i < ndpi_min(url_entries_count, NDPI_ARRAY_LENGTH(flow->protos.slp.url)); ++i) { if (packet->payload_packet_len < url_entries_offset + sizeof(*url_entry)) { return 1; } @@ -171,7 +172,8 @@ static int slp_dissect_url_entries(struct ndpi_detection_module_struct *ndpi_str // handle Authentication Blocks uint8_t num_auths = packet->payload[url_entries_offset++]; - for (size_t j = 0; j < num_auths; ++j) { + size_t j; + for (j = 0; j < num_auths; ++j) { size_t auth_block_offset = url_entries_offset + 2; if (packet->payload_packet_len <= auth_block_offset + 2) { return 1; |