diff options
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | filter/config.Y | 3 | ||||
-rw-r--r-- | filter/filter.c | 14 | ||||
-rw-r--r-- | filter/test.conf | 5 | ||||
-rw-r--r-- | sysdep/config.h | 8 | ||||
-rw-r--r-- | tools/Makefile.in | 18 |
6 files changed, 34 insertions, 17 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/filter/config.Y b/filter/config.Y index 5cff47e..ee4e638 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -396,8 +396,9 @@ symbol: 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 9c1dfa3..3df0f0c 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; } @@ -136,7 +138,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; @@ -156,7 +159,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; } } @@ -501,6 +504,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; @@ -868,10 +872,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)) @@ -886,6 +892,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; diff --git a/filter/test.conf b/filter/test.conf index 7c05af0..f3b7961 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -171,6 +171,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: "; @@ -218,4 +221,4 @@ int j; accept "ok I take that"; } -eval __startup();
\ No newline at end of file +eval __startup(); diff --git a/sysdep/config.h b/sysdep/config.h index 45648ad..df6e6df 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..6307cf0 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -43,24 +43,24 @@ 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)/ + $(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)/ ; \ + $(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ; \ fi - if ! test -f $(sysconfdir)/bird.conf ; then \ - $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(sysconfdir)/bird.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.conf" ; \ + 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 - 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 |