Re: Problem with case / else: in filters

2011-01-01 Thread Ondrej Zajicek
On Fri, Dec 31, 2010 at 09:30:51AM +0100, Jerome Durand wrote:
 Yep, that was a copy/paste error (I tool the example from the web site)
 Actually I found a workaround for which I don't need an else:  
 statement, and which is much better... !

 Here was the faulty filter (of course replace example, XXX, prefix1 and  
 prefix1 by valid info!)

 filter in_asset_ASexample {
   if is_nexthop_false() then reject;
   case bgp_path.last {
 example: if ! (net ~ [ pref1+, pref2+ ]) then  
 bgp_community.add((myas,XXX));
 else: bgp_community.add((myas,XXX));
   }

So the problem appears only when there is if/then in the case
before else: branch. It seems like a problem in BIRD grammar.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.


signature.asc
Description: Digital signature


Re: Problem with case / else: in filters

2010-12-31 Thread Jerome Durand

Yep, that was a copy/paste error (I tool the example from the web site)
Actually I found a workaround for which I don't need an else: 
statement, and which is much better... !


Here was the faulty filter (of course replace example, XXX, prefix1 and 
prefix1 by valid info!)


filter in_asset_ASexample {
  if is_nexthop_false() then reject;
  case bgp_path.last {
example: if ! (net ~ [ pref1+, pref2+ ]) then 
bgp_community.add((myas,XXX));

else: bgp_community.add((myas,XXX));
  }
  accept;
}

Script returns:
bird: bird.conf.201012301556, line 169: syntax error
line 169 is the line with the else statement...

But if I reload the conf it seems to work...

Thanks,

Jerome




Le 30/12/2010 21:13, Ondrej Zajicek a écrit :

On Thu, Dec 30, 2010 at 03:01:26PM +0100, Jerome Durand wrote:

Hi all,

I'm runnning bird6 version 1.2.5 and bird version 1.2.5 and I'm
experiencing a problem:

Bird returns a syntax error at the else: line while bird6 tells me
it's okay. Is this a well known bug or am I doing somethinig wrong? Do
you see any workaround?


For me, it works as expected - with else: in IPv4 version.
In your example (below) you are missing closing }.
But perhaps that is just a copy/paste error.


case arg1 {
 2: print two; print I can do more commands without {};
 3 .. 5: print three to five;
 else: print something else;

Note that I got the version via apt-get on Debian...





--
-
Jerome Durand

Responsable des services aux usagers
Services operations  support manager

Réseau National de Télécommunications
 pour la Technologie, l'Enseignement et la Recherche

Tel:+33 (0) 1 53 94 20 40  |  GIP RENATER
Fax:+33 (0) 1 53 94 20 41  |  23-25 rue Daviel
E-mail: jdur...@renater.fr |  75013 PARIS
http://www.renater.fr  |  FRANCE
--





smime.p7s
Description: S/MIME Cryptographic Signature


Problem with case / else: in filters

2010-12-30 Thread Jerome Durand

Hi all,

I'm runnning bird6 version 1.2.5 and bird version 1.2.5 and I'm 
experiencing a problem:


Bird returns a syntax error at the else: line while bird6 tells me 
it's okay. Is this a well known bug or am I doing somethinig wrong? Do 
you see any workaround?


case arg1 {
2: print two; print I can do more commands without {};
3 .. 5: print three to five;
else: print something else;

Note that I got the version via apt-get on Debian...

Thanks!!


--
-
Jerome Durand

Responsable des services aux usagers
Services operations  support manager

Réseau National de Télécommunications
 pour la Technologie, l'Enseignement et la Recherche

Tel:+33 (0) 1 53 94 20 40  |  GIP RENATER
Fax:+33 (0) 1 53 94 20 41  |  23-25 rue Daviel
E-mail: jdur...@renater.fr |  75013 PARIS
http://www.renater.fr  |  FRANCE
--





smime.p7s
Description: S/MIME Cryptographic Signature