On Mon, Sep 06, 2010 at 08:28:47PM +0200, Ondrej Zajicek wrote: > > But there is another issue: > > > > function check_community (clist c) > > pair set wrong; > > { > > wrong = [ > > (0,0)..(0,25371), > > (0,25373)..(0,31209), > > (0,31211)..(31209,65535), > > (31210,0)..(31210,25371), > > (31210,25373)..(31210,65535), > > (31211,0)..(65535,65281), > > (65535,65283)..(65535,65535) > > ]; > > c = delete(c,wrong); > > print c; > > } > > > > bird reports in log file: > > Sep 6 20:26:38 crete bird: filters, line 37: Can't add/delete non-pair > > This code works for me. > > This is a recent feature, perhaps you are using an old version of BIRD. > Try version 1.2.4 . I'm using 1.2.4.
Where do you call a function from? In my configuration it is called from filter: function check_community (clist c) pair set wrong; { wrong = [ (0,0)..(0,25371), (0,25373)..(0,31209), (0,31211)..(31209,65535), (31210,0)..(31210,25371), (31210,25373)..(31210,65535), (31211,0)..(65535,65281), (65535,65283)..(65535,65535) ]; c = delete(c,wrong); print c; } # ---------------------------------------------------------------------------- filter flt_itcons_i prefix set plist; { check_community(bgp_community); plist = [ 194.247.174.0/23, 91.200.192.0/22, 109.68.40.0/21, 91.197.128.0/24, 91.197.129.0/24, 91.197.131.0/24, 91.197.128.0/23 ]; if net ~ plist then accept; else reject; } bird still reports error: Sep 7 13:45:58 crete bird: filters, line 37: Can't add/delete non-pair Also I tried fillowing config: function check_community () pair set wrong; { wrong = [ (0,0)..(0,25371), (0,25373)..(0,31209), (0,31211)..(31209,65535), (31210,0)..(31210,25371), (31210,25373)..(31210,65535), (31211,0)..(65535,65281), (65535,65283)..(65535,65535) ]; bgp_community.delete(wrong); print bgp_community; } filter flt_itcons_i prefix set plist; { check_community(); plist = [ 194.247.174.0/23, 91.200.192.0/22, 109.68.40.0/21, 91.197.128.0/24, 91.197.129.0/24, 91.197.131.0/24, 91.197.128.0/23 ]; if net ~ plist then accept; else reject; } Error is the same: Sep 7 13:45:58 crete bird: filters, line 37: Can't add/delete non-pair -- MINO-RIPE