From 029dc60f11b234537c23b6bdb1372c2f8a88628e Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Tue, 16 Apr 2024 15:02:05 +0200 Subject: [PATCH 1/2] Change: boreas. Use sequence number 1 and a random ping ID Close #812 Jira: SC-1064 --- boreas/ping.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/boreas/ping.c b/boreas/ping.c index cfbfbabc..eb69b9fe 100644 --- a/boreas/ping.c +++ b/boreas/ping.c @@ -54,6 +54,16 @@ struct pseudohdr struct tcphdr tcpheader; }; +// Return a random uint16 avoiding the 0. +static uint16_t +get_echo_id (void) +{ + uint16_t upper_bound = 65534; + uint16_t lower_bound = 1; + + return rand () % (upper_bound - lower_bound + 1) + lower_bound; +} + /** * @brief Get the size of the socket send buffer. * @@ -144,8 +154,8 @@ send_icmp_v6 (int soc, struct in6_addr *dst, int type) icmp6 = (struct icmp6_hdr *) sendbuf; icmp6->icmp6_type = type; /* ND_NEIGHBOR_SOLICIT or ICMP6_ECHO_REQUEST */ icmp6->icmp6_code = 0; - icmp6->icmp6_id = 234; - icmp6->icmp6_seq = 0; + icmp6->icmp6_id = get_echo_id (); + icmp6->icmp6_seq = 0x0100; memset ((icmp6 + 1), 0xa5, datalen); gettimeofday ((struct timeval *) (icmp6 + 1), NULL); // only for testing @@ -197,6 +207,8 @@ send_icmp_v4 (int soc, struct in_addr *dst) icmp = (struct icmphdr *) sendbuf; icmp->type = ICMP_ECHO; icmp->code = 0; + icmp->un.echo.id = get_echo_id (); + icmp->un.echo.sequence = 0x0100; len = 8 + datalen; icmp->checksum = 0; From d8d5d1ec32710cc104d9144d55fa4dd4e2c1e163 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 18 Apr 2024 09:35:18 +0200 Subject: [PATCH 2/2] Fix libhiredis version for docker testing --- .docker/prod-testing.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/prod-testing.Dockerfile b/.docker/prod-testing.Dockerfile index 87d89633..79380e59 100644 --- a/.docker/prod-testing.Dockerfile +++ b/.docker/prod-testing.Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && \ libgnutls30 \ libuuid1 \ libssh-gcrypt-4 \ - libhiredis0.14 \ + libhiredis1.1.0 \ libhiredis-dev \ libxml2 \ libpcap0.8 \