From 496e08f9d93c1ccac7d4348ea3b314c5ab2c6d68 Mon Sep 17 00:00:00 2001 From: AKP Date: Sat, 11 Nov 2023 18:19:22 +0000 Subject: [PATCH] Ensure that ending ports are checked when starting ports are equal --- firewall_types.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firewall_types.c b/firewall_types.c index d6c601a..3f3a74a 100644 --- a/firewall_types.c +++ b/firewall_types.c @@ -44,6 +44,12 @@ int compare_rule(struct Rule *a, struct Rule *b) { result = akpa_numcmp(a->port.start, b->port.start); } + if (result == 0) { + if ((a->port.end != NULL) || (b->port.end != NULL)) { + result = akpa_numcmp(*a->port.end, *b->port.end); + } + } + return result; }