From 4d4979c67c65dceb1ae557707312b83fde4bc8a8 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 20 Nov 2013 13:25:33 +0100 Subject: [PATCH 1/2] Fixes some potential issues with invalid term size in clients. --- client/birdc.c | 4 ++-- client/birdcl.c | 5 ----- client/client.c | 4 ++++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/birdc.c b/client/birdc.c index 9dd6d9b9..bbe18331 100644 --- a/client/birdc.c +++ b/client/birdc.c @@ -148,8 +148,8 @@ input_init(void) rl_callback_handler_install("bird> ", input_got_line); // rl_get_screen_size(); - term_lns = LINES ? LINES : 25; - term_cls = COLS ? COLS : 80; + term_lns = LINES; + term_cls = COLS; prompt_active = 1; diff --git a/client/birdcl.c b/client/birdcl.c index c41b046c..2d5e1067 100644 --- a/client/birdcl.c +++ b/client/birdcl.c @@ -150,11 +150,6 @@ input_init(void) term_lns = tws.ws_row; term_cls = tws.ws_col; } - else - { - term_lns = 25; - term_cls = 80; - } } void diff --git a/client/client.c b/client/client.c index 61caf38b..a9d0096d 100644 --- a/client/client.c +++ b/client/client.c @@ -178,6 +178,10 @@ init_commands(void) } input_init(); + + term_lns = (term_lns > 0) ? term_lns : 25; + term_cls = (term_cls > 0) ? term_cls : 80; + init = 0; } From f8f2419d4c5b9028b9b3d2d893fe802f18eb239b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 20 Nov 2013 13:30:00 +0100 Subject: [PATCH 2/2] Additional filter test case. --- filter/test.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/filter/test.conf b/filter/test.conf index 03b09c30..c4108f9d 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -265,6 +265,7 @@ ec cc; int set is; pair set ps; ec set ecs; +ip set ips; prefix set pxs; string s; { @@ -360,6 +361,12 @@ string s; if ( b = true ) then print "Testing bool comparison b = true: ", b; else { print "*** FAIL: TRUE test failed" ; quitbird; } + ips = [ 1.1.1.0 .. 1.1.1.255, 1.2.2.2]; + print "Testing IP sets: "; + print ips; + print " must be true: ", 1.1.1.0 ~ ips, ",", 1.1.1.100 ~ ips, ",", 1.2.2.2 ~ ips; + print " must be false: ", 1.1.0.255 ~ ips, ",", 1.1.2.0 ~ ips, ",", 1.2.2.3 ~ ips, ",", 192.168.1.1 ~ ips; + pxs = [ 1.2.0.0/16, 1.4.0.0/16+]; print "Testing prefix sets: "; print pxs; @@ -386,6 +393,9 @@ string s; print "1.2.3.4 = ", onetwo; + i = 4200000000; + print "4200000000 = ", i, " false: ", i = 4200000000, " ", i > 4100000000, " false: ", i > 4250000000; + test_undef(2); test_undef(3); test_undef(2);