From 0a4198b35a2c8085942ba1055b1766000f2825c4 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sat, 24 Aug 2024 16:55:20 +0200 Subject: Fix for old gcc compilers --- tests/unit/unit.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/unit.c b/tests/unit/unit.c index 8e797a3b1..75157a0a7 100644 --- a/tests/unit/unit.c +++ b/tests/unit/unit.c @@ -282,11 +282,14 @@ int serializeProtoUnitTest(void) } assert(ndpi_init_serializer(&serializer, fmt) != -1); - ndpi_protocol ndpi_proto = { .proto.master_protocol = NDPI_PROTOCOL_TLS, - .proto.app_protocol = NDPI_PROTOCOL_FACEBOOK, - .protocol_by_ip = NDPI_PROTOCOL_FACEBOOK, - .category = NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK }; + ndpi_protocol ndpi_proto; ndpi_risk risks = 0; + + ndpi_proto.proto.master_protocol = NDPI_PROTOCOL_TLS, + ndpi_proto.proto.app_protocol = NDPI_PROTOCOL_FACEBOOK, + ndpi_proto.protocol_by_ip = NDPI_PROTOCOL_FACEBOOK, + ndpi_proto.category = NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK; + NDPI_SET_BIT(risks, NDPI_MALFORMED_PACKET); NDPI_SET_BIT(risks, NDPI_TLS_WEAK_CIPHER); NDPI_SET_BIT(risks, NDPI_TLS_OBSOLETE_VERSION); -- cgit v1.2.3