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; }