From dd8481cc1c92af32ec69cded42b985b7bad40b26 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 18 May 2021 19:54:18 +0200 Subject: Flowspec: Do not use comma for bitmask operators For numeric operators, comma is used for disjunction in expressions like "10, 20, 30..40". But for bitmask operators, comma is used for conjunction in a way that does not really make much sense. Use always explicit logical operators (&& and ||) to connect bitmask operators. Thanks to Matt Corallo for the bugreport. --- lib/flowspec.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib/flowspec.c') diff --git a/lib/flowspec.c b/lib/flowspec.c index e47fb7e2..1445435a 100644 --- a/lib/flowspec.c +++ b/lib/flowspec.c @@ -1278,17 +1278,8 @@ net_format_flow_bitmask(buffer *b, const byte *part) while (1) { if (!first) - { - if (isset_and(op)) - { - b->pos--; /* Remove last char (it is a space) */ - buffer_puts(b, ","); - } - else - { - buffer_puts(b, "|| "); - } - } + buffer_puts(b, isset_and(op) ? "&& " : "|| "); + first = 0; len = get_value_length(op); -- cgit v1.2.3