From 0b013b25cba03d65f4d68cab88105b134b10e9d3 Mon Sep 17 00:00:00 2001 From: Alexandre Snarskii Date: Wed, 1 Jul 2015 17:09:14 +0300 Subject: [PATCH] bugfix: no sources in command-line could lead to no source limit sent to IRRd. --- CHANGES | 4 ++++ bgpq3.c | 3 ++- bgpq_expander.c | 2 ++ configure | 18 +++++++++--------- configure.in | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index c203163..008a0c7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +0.1.32-rc2 (2015-06-28) + - bugfix: when no sources provided in command line and via IRRD_SOURCES env, + no source limitation were sent to IRRd. Thanks to Mikhail A. Grishin. + 0.1.32-rc (2015-06-28) - bugfix: F source(s) unavailable message from IRRD was ignored. Please note: this error is caught only when all the specified sources diff --git a/bgpq3.c b/bgpq3.c index b665ef0..2265348 100644 --- a/bgpq3.c +++ b/bgpq3.c @@ -126,7 +126,8 @@ main(int argc, char* argv[]) unsigned long maxlen=0; bgpq_expander_init(&expander,af); - expander.sources=getenv("IRRD_SOURCES"); + if (getenv("IRRD_SOURCES")) + expander.sources=getenv("IRRD_SOURCES"); while((c=getopt(argc,argv,"2346AbdDES:jJf:l:m:M:W:Ppr:R:G:Th:X"))!=EOF) { switch(c) { diff --git a/bgpq_expander.c b/bgpq_expander.c index 05b02a4..e6b1b2a 100644 --- a/bgpq_expander.c +++ b/bgpq_expander.c @@ -521,8 +521,10 @@ bgpq_expand(struct bgpq_expander* b) if(b->sources && b->sources[0]!=0) { char sources[128]; snprintf(sources,sizeof(sources),"!s%s\n", b->sources); + SX_DEBUG(debug_expander,"Requesting sources %s", sources); fwrite(sources,strlen(sources),1,f); fgets(sources,sizeof(sources),f); + SX_DEBUG(debug_expander,"Got answer %s", sources); if(sources[0]!='C') { sx_report(SX_ERROR, "Invalid source(s) '%s': %s\n", b->sources, sources); diff --git a/configure b/configure index 2056051..9ffc455 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bgpq3 0.1.32-rc. +# Generated by GNU Autoconf 2.69 for bgpq3 0.1.32-rc2. # # Report bugs to . # @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bgpq3' PACKAGE_TARNAME='bgpq3' -PACKAGE_VERSION='0.1.32-rc' -PACKAGE_STRING='bgpq3 0.1.32-rc' +PACKAGE_VERSION='0.1.32-rc2' +PACKAGE_STRING='bgpq3 0.1.32-rc2' PACKAGE_BUGREPORT='snar@snar.spb.ru' PACKAGE_URL='' @@ -1187,7 +1187,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bgpq3 0.1.32-rc to adapt to many kinds of systems. +\`configure' configures bgpq3 0.1.32-rc2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1248,7 +1248,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bgpq3 0.1.32-rc:";; + short | recursive ) echo "Configuration of bgpq3 0.1.32-rc2:";; esac cat <<\_ACEOF @@ -1327,7 +1327,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bgpq3 configure 0.1.32-rc +bgpq3 configure 0.1.32-rc2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1495,7 +1495,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bgpq3 $as_me 0.1.32-rc, which was +It was created by bgpq3 $as_me 0.1.32-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3413,7 +3413,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bgpq3 $as_me 0.1.32-rc, which was +This file was extended by bgpq3 $as_me 0.1.32-rc2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3475,7 +3475,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bgpq3 config.status 0.1.32-rc +bgpq3 config.status 0.1.32-rc2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 4b770a0..3cc8247 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(bgpq3,0.1.32-rc,snar@snar.spb.ru) +AC_INIT(bgpq3,0.1.32-rc2,snar@snar.spb.ru) AC_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_INSTALL