From a6c9f0648db56175ee9e077e2ca631b678552835 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Thu, 28 May 2009 13:37:04 +0200 Subject: Missing boolean comparison added. --- filter/filter.c | 3 ++- filter/test.conf | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/filter/filter.c b/filter/filter.c index 313d2fa..944befb 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -120,7 +120,8 @@ val_compare(struct f_val v1, struct f_val v2) } switch (v1.type) { case T_ENUM: - case T_INT: + case T_INT: + case T_BOOL: case T_PAIR: if (v1.val.i == v2.val.i) return 0; if (v1.val.i < v2.val.i) return -1; diff --git a/filter/test.conf b/filter/test.conf index af88907..f1cdf04 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -155,6 +155,9 @@ string s; b = true; print "Testing bool: ", b, ", ", !b; + + if ( b = true ) then print "Testing bool comparison b = true: ", b; + else { print "*** FAIL: TRUE test failed" ; quitbird; } pxs = [ 1.2.0.0/16, 1.4.0.0/16+]; print "Testing prefix sets: "; @@ -202,4 +205,4 @@ int j; accept "ok I take that"; } -eval __startup(); \ No newline at end of file +eval __startup(); -- cgit v1.2.3 From d59405ec6652e95f4825492c7322536bb7044db0 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Fri, 29 May 2009 23:02:36 +0200 Subject: Typo in warning fixed. --- filter/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter/filter.c b/filter/filter.c index 944befb..fe3c9cb 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -141,7 +141,7 @@ val_compare(struct f_val v1, struct f_val v2) case T_STRING: return strcmp(v1.val.s, v2.val.s); default: - debug( "Compare of unkown entities: %x\n", v1.type ); + debug( "Compare of unknown entities: %x\n", v1.type ); return CMP_ERROR; } } -- cgit v1.2.3 From 43de796b8a10f561d8b3ef64a86e5ce70de01eb5 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Fri, 29 May 2009 23:04:54 +0200 Subject: Function pm_path_compare() checked just length of the bgpmasks --- filter/filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filter/filter.c b/filter/filter.c index fe3c9cb..deaea34 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -64,6 +64,8 @@ pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2) while (1) { if ((!m1) || (!m2)) return !((!m1) && (!m2)); + + if ((m1->kind != m2->kind) || (m1->val != m2->val)) return 1; m1 = m1->next; m2 = m2->next; } -- cgit v1.2.3 From 9be1086d2970633fb5af2a1faaae16d5a1cf48ea Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Fri, 29 May 2009 23:08:28 +0200 Subject: New type variable 'V' defined in filters. This type is checked only for name, never for value in function filter_same() --- filter/config.Y | 3 ++- filter/filter.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/filter/config.Y b/filter/config.Y index 6d9b064..fe79496 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -397,8 +397,9 @@ term: case SYM_VARIABLE | T_PATH: case SYM_VARIABLE | T_PATH_MASK: case SYM_VARIABLE | T_CLIST: - $$->code = 'C'; + $$->code = 'V'; $$->a1.p = $1->def; + $$->a2.p = $1->name; break; default: cf_error("%s: variable expected.", $1->name ); diff --git a/filter/filter.c b/filter/filter.c index deaea34..fe3a2ac 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -489,6 +489,7 @@ interpret(struct f_inst *what) else res.val.i = what->a2.i; break; + case 'V': case 'C': res = * ((struct f_val *) what->a1.p); break; @@ -855,10 +856,12 @@ i_same(struct f_inst *f1, struct f_inst *f2) case T_PREFIX_SET: if (!trie_same(f1->a2.p, f2->a2.p)) return 0; + break; case T_SET: if (!same_tree(f1->a2.p, f2->a2.p)) return 0; + break; case T_STRING: if (strcmp(f1->a2.p, f2->a2.p)) @@ -873,6 +876,10 @@ i_same(struct f_inst *f1, struct f_inst *f2) if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p)) return 0; break; + case 'V': + if (strcmp((char *) f1->a2.p, (char *) f2->a2.p)) + return 0; + break; case 'p': case 'L': ONEARG; break; case '?': TWOARGS; break; case '0': case 'E': break; -- cgit v1.2.3 From dc16584ac2be1c097acbf8a0b2f6d412214f2a01 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 2 Jun 2009 00:28:08 +0200 Subject: Small change to make BIRD's IPv6 packaging easier --- configure.in | 3 +++ sysdep/config.h | 8 ++++---- tools/Makefile.in | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index d1b503b..8d519fd 100644 --- a/configure.in +++ b/configure.in @@ -42,11 +42,13 @@ AC_SUBST(srcdir_rel_mf) if test "$enable_ipv6" = yes ; then ip=ipv6 + SUFFIX6=6 if test "$with_protocols" = all ; then with_protocols=bgp,pipe,rip,static fi else ip=ipv4 + SUFFIX6="" if test "$with_protocols" = all ; then with_protocols=bgp,ospf,pipe,rip,static fi @@ -208,6 +210,7 @@ if test "$enable_client" = yes ; then fi AC_SUBST(CLIENT) AC_SUBST(CLIENT_LIBS) +AC_SUBST(SUFFIX6) mkdir -p $objdir/sysdep AC_CONFIG_HEADERS([$objdir/sysdep/autoconf.h:sysdep/autoconf.h.in]) diff --git a/sysdep/config.h b/sysdep/config.h index 47d175b..f0a5ecc 100644 --- a/sysdep/config.h +++ b/sysdep/config.h @@ -38,11 +38,11 @@ typedef u16 word; /* Path to configuration file */ #ifdef IPV6 # ifdef DEBUGGING -# define PATH_CONFIG "bird-6.conf" -# define PATH_CONTROL_SOCKET "bird-6.ctl" +# define PATH_CONFIG "bird6.conf" +# define PATH_CONTROL_SOCKET "bird6.ctl" # else -# define PATH_CONFIG PATH_CONFIG_DIR "/bird-6.conf" -# define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird-6.ctl" +# define PATH_CONFIG PATH_CONFIG_DIR "/bird6.conf" +# define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird6.ctl" # endif #else # ifdef DEBUGGING diff --git a/tools/Makefile.in b/tools/Makefile.in index 8b901ef..17b4db7 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -44,12 +44,12 @@ tags: install: all $(INSTALL) -d $(sbindir) $(sysconfdir) $(localstatedir) - $(INSTALL_PROGRAM) -s $(exedir)/bird $(sbindir)/ + $(INSTALL_PROGRAM) -s $(exedir)/bird $(sbindir)/bird@SUFFIX6@ if test -n "@CLIENT@" ; then \ - $(INSTALL_PROGRAM) -s $(exedir)/birdc $(sbindir)/ ; \ + $(INSTALL_PROGRAM) -s $(exedir)/birdc $(sbindir)/birdc@SUFFIX6@ ; \ fi - if ! test -f $(sysconfdir)/bird.conf ; then \ - $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird.conf ; \ + if ! test -f $(sysconfdir)/bird.@SUFFIX6@conf ; then \ + $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird@SUFFIX6@.conf ; \ else \ echo "Not overwriting old bird.conf" ; \ fi -- cgit v1.2.3 From de8f238fdb85bdba8ce4b5988584403cf5dbcd1e Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 2 Jun 2009 11:00:12 +0200 Subject: Error in test fixed. --- tools/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Makefile.in b/tools/Makefile.in index 17b4db7..33e5c25 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -48,7 +48,7 @@ install: all if test -n "@CLIENT@" ; then \ $(INSTALL_PROGRAM) -s $(exedir)/birdc $(sbindir)/birdc@SUFFIX6@ ; \ fi - if ! test -f $(sysconfdir)/bird.@SUFFIX6@conf ; then \ + if ! test -f $(sysconfdir)/bird@SUFFIX6@.conf ; then \ $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird@SUFFIX6@.conf ; \ else \ echo "Not overwriting old bird.conf" ; \ -- cgit v1.2.3 From 26978ec419217fccfbb8901033703ede886e78b7 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 2 Jun 2009 11:36:07 +0200 Subject: Clean also ipv6 bird.ctl --- tools/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Makefile.in b/tools/Makefile.in index 33e5c25..156a2eb 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -51,7 +51,7 @@ install: all if ! test -f $(sysconfdir)/bird@SUFFIX6@.conf ; then \ $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird@SUFFIX6@.conf ; \ else \ - echo "Not overwriting old bird.conf" ; \ + echo "Not overwriting old bird@SUFFIX@.conf" ; \ fi install-docs: @@ -60,7 +60,7 @@ install-docs: clean: find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f - rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl .dep-stamp + rm -f $(exedir)/bird $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp distclean: clean rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules -- cgit v1.2.3 From 99355da18f8598e93d0e55167582da9687eae082 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Tue, 2 Jun 2009 12:01:24 +0200 Subject: Inlude DESTDIR in install to make life of packagers easier. --- tools/Makefile.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/Makefile.in b/tools/Makefile.in index 156a2eb..6307cf0 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -43,20 +43,20 @@ tags: cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]` install: all - $(INSTALL) -d $(sbindir) $(sysconfdir) $(localstatedir) - $(INSTALL_PROGRAM) -s $(exedir)/bird $(sbindir)/bird@SUFFIX6@ + $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir) + $(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@ if test -n "@CLIENT@" ; then \ - $(INSTALL_PROGRAM) -s $(exedir)/birdc $(sbindir)/birdc@SUFFIX6@ ; \ + $(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ; \ fi - if ! test -f $(sysconfdir)/bird@SUFFIX6@.conf ; then \ - $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird@SUFFIX6@.conf ; \ + if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then \ + $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; \ else \ echo "Not overwriting old bird@SUFFIX@.conf" ; \ fi install-docs: - $(INSTALL) -d $(docdir) - $(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(docdir)/ + $(INSTALL) -d $(DESTDIR)/$(docdir) + $(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/ clean: find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f -- cgit v1.2.3