diff -Nru bird-1.6.3/aclocal.m4 bird-1.6.4/aclocal.m4 --- bird-1.6.3/aclocal.m4 2016-12-22 22:53:39.000000000 +0000 +++ bird-1.6.4/aclocal.m4 2018-03-24 14:57:53.000000000 +0000 @@ -1,162 +1,57 @@ dnl ** Additional Autoconf tests for BIRD configure script dnl ** (c) 1999 Martin Mares -AC_DEFUN(BIRD_CHECK_INTEGERS, -[AC_CHECK_SIZEOF(char, 0) -AC_CHECK_SIZEOF(short int, 0) -AC_CHECK_SIZEOF(int, 0) -AC_CHECK_SIZEOF(long int, 0) -AC_CHECK_SIZEOF(long long int, 0) -for size in 1 2 4 8; do - bits=`expr $size "*" 8` - AC_MSG_CHECKING([for $bits-bit type]) - if test $ac_cv_sizeof_int = $size ; then - res=int - elif test $ac_cv_sizeof_char = $size ; then - res=char - elif test $ac_cv_sizeof_short_int = $size ; then - res="short int" - elif test $ac_cv_sizeof_long_int = $size ; then - res="long int" - elif test $ac_cv_sizeof_long_long_int = $size ; then - res="long long int" - else - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Cannot find $bits-bit integer type.]) - fi - AC_MSG_RESULT($res) - AC_DEFINE_UNQUOTED(INTEGER_$bits, $res) - done -]) - -dnl BIRD_CHECK_ENDIAN is unused and obsolete -AC_DEFUN(BIRD_CHECK_ENDIAN, -[AC_CACHE_CHECK([CPU endianity], bird_cv_c_endian,[ -AC_TRY_RUN([ -#include - -unsigned int x = 0x12345678; -unsigned char *z = (unsigned char *) &x; - -int main(void) -{ - FILE *f = fopen("conftestresult", "w"); - if (!f) return 10; - fprintf(f, "%02x %02x %02x %02x", *z, *(z+1), *(z+2), *(z+3)); - fclose(f); - exit(0); -} -],[ - endian=`cat conftestresult` - if test "$endian" = "12 34 56 78" ; then - bird_cv_c_endian=big-endian - elif test "$endian" = "78 56 34 12" ; then - bird_cv_c_endian=little-endian - fi -],[endian="test program failed"],[endian="not available, we're cross compiling"]) -if test -z "$bird_cv_c_endian" ; then - AC_MSG_RESULT($endian) - AC_MSG_ERROR([Cannot determine CPU endianity.]) - fi -]) -case $bird_cv_c_endian in - big-endian) AC_DEFINE(CPU_BIG_ENDIAN) ;; - little-endian) AC_DEFINE(CPU_LITTLE_ENDIAN) ;; - esac -]) - -AC_DEFUN(BIRD_CHECK_STRUCT_ALIGN, -[AC_CACHE_CHECK([usual alignment of structures],bird_cv_c_struct_align,[ -AC_TRY_RUN([ -#include - -struct { char x; long int y; } ary[2]; - -int main(void) -{ - FILE *f = fopen("conftestresult", "w"); - if (!f) return 10; - fprintf(f, "%d", sizeof(ary)/2); - fclose(f); - exit(0); -} -],[ -bird_cv_c_struct_align=`cat conftestresult` -],[ -AC_MSG_RESULT([test program failed]) -AC_MSG_ERROR([Cannot determine structure alignment]) -],[bird_cv_c_struct_align=16]) -]) -AC_DEFINE_UNQUOTED(CPU_STRUCT_ALIGN, $bird_cv_c_struct_align) -]) - -AC_DEFUN(BIRD_CHECK_TIME_T, -[AC_CACHE_CHECK([characteristics of time_t], bird_cv_type_time_t, [ -AC_TRY_RUN([ -#include -#include -#include - -int main(void) -{ - FILE *f = fopen("conftestresult", "w"); - if (!f) return 10; - fprintf(f, "%d-bit ", sizeof(time_t)*CHAR_BIT); - if ((time_t) -1 > 0) fprintf(f, "un"); - fprintf(f, "signed"); - fclose(f); - exit(0); -} -],[bird_cv_type_time_t=`cat conftestresult` -],[ AC_MSG_RESULT([test program failed]) - AC_MSG_ERROR([Cannot determine time_t size and signedness.]) -],[bird_cv_type_time_t="32-bit signed"]) -]) -case "$bird_cv_type_time_t" in - *64-bit*) AC_DEFINE(TIME_T_IS_64BIT) ;; - esac -case "$bird_cv_type_time_t" in - *unsigned*) ;; - *) AC_DEFINE(TIME_T_IS_SIGNED) ;; - esac -]) - -AC_DEFUN(BIRD_CHECK_STRUCT_IP_MREQN, -[AC_CACHE_CHECK([for struct ip_mreqn], bird_cv_struct_ip_mreqn,[ -AC_TRY_COMPILE([#include -],[struct ip_mreqn x; -],[bird_cv_struct_ip_mreqn=yes -],[bird_cv_struct_ip_mreqn=no -])]) -if test "$bird_cv_struct_ip_mreqn" = yes ; then - AC_DEFINE(HAVE_STRUCT_IP_MREQN) -fi -]) - -AC_DEFUN(BIRD_CHECK_PTHREADS, +AC_DEFUN([BIRD_CHECK_PTHREADS], [ bird_tmp_cflags="$CFLAGS" - CFLAGS="$CFLAGS -pthread" - AC_CACHE_CHECK([whether POSIX threads are available], bird_cv_lib_pthreads, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[pthread_t pt; pthread_create(&pt, NULL, NULL, NULL); pthread_spinlock_t lock; pthread_spin_lock(&lock); ]])], - [bird_cv_lib_pthreads=yes], [bird_cv_lib_pthreads=no])]) + + AC_CACHE_CHECK( + [whether POSIX threads are available], + [bird_cv_lib_pthreads], + [ + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM( + [ #include ], + [ + pthread_t pt; + pthread_create(&pt, NULL, NULL, NULL); + pthread_spinlock_t lock; + pthread_spin_lock(&lock); + ] + ) + ], + [bird_cv_lib_pthreads=yes], + [bird_cv_lib_pthreads=no] + ) + ] + ) CFLAGS="$bird_tmp_cflags" ]) -AC_DEFUN(BIRD_CHECK_GCC_OPTION, +AC_DEFUN([BIRD_CHECK_GCC_OPTION], [ bird_tmp_cflags="$CFLAGS" - CFLAGS="$3 $2" - AC_CACHE_CHECK([whether CC supports $2], $1, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [$1=yes], [$1=no])]) + + AC_CACHE_CHECK( + [whether CC supports $2], + [$1], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM()], + [$1=yes], + [$1=no] + ) + ] + ) CFLAGS="$bird_tmp_cflags" ]) -AC_DEFUN(BIRD_ADD_GCC_OPTION, +AC_DEFUN([BIRD_ADD_GCC_OPTION], [ if test "$$1" = yes ; then CFLAGS="$CFLAGS $2" @@ -164,14 +59,19 @@ ]) # BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE]) -# copied autoconf internal _AC_PATH_PROG_FLAVOR_GNU -m4_define([BIRD_CHECK_PROG_FLAVOR_GNU], -[# Check for GNU $1 -case `"$1" --version 2>&1` in -*GNU*) - $2;; -m4_ifval([$3], -[*) - $3;; -])esac -])# +# copied from autoconf internal _AC_PATH_PROG_FLAVOR_GNU +AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU], +[ + # Check for GNU $1 + case `"$1" --version 2>&1` in + *GNU*) + $2 + ;; + m4_ifval([$3], + [*) + $3 + ;; + ] + ) + esac +]) Binary files /tmp/tmpdvA_rW/fYJCRRyqPV/bird-1.6.3/bird-doc-164.tgz and /tmp/tmpdvA_rW/z1RwriU8ls/bird-1.6.4/bird-doc-164.tgz differ diff -Nru bird-1.6.3/ChangeLog bird-1.6.4/ChangeLog --- bird-1.6.3/ChangeLog 2016-12-22 22:54:54.000000000 +0000 +++ bird-1.6.4/ChangeLog 2018-03-24 15:10:22.000000000 +0000 @@ -1,3 +1,687 @@ +commit 4c0b741ba7419e2cb816e1dc9a23096234d998e2 +Author: Ondrej Zajicek (work) +Date: Sat Mar 24 01:53:03 2018 +0100 + + Doc: Remove some superfluous slashes + +commit f99c61b1f4fb8fcf0e7373f3e2ea254682c622a4 +Author: Ondrej Zajicek (work) +Date: Sat Mar 24 01:34:58 2018 +0100 + + Doc: Be consistent in generating pdf output + +commit 2ee6a89a8dfe942ee5b8451cac15353e205f172a +Author: Ondrej Filip +Date: Fri Mar 23 17:22:55 2018 +0100 + + Autoconf replaced by autoreconf + +commit f77fb3f00e2d628224c5397f2ad0198026d4290a +Author: Ondrej Filip +Date: Thu Mar 22 13:33:12 2018 +0100 + + Date added. + +commit a71a75213d485aa8db89426e22d4690269ee1327 +Author: Ondrej Zajicek (work) +Date: Wed Mar 21 15:41:24 2018 +0100 + + NEWS and version update + +commit 4dff1f32b5e2b2769e59560f404346af03abcbb6 +Author: Ondrej Zajicek (work) +Date: Wed Mar 21 16:22:59 2018 +0100 + + Doc: Minor build fix + +commit 97b1b04d937ac7da65d6ab109b9f5dc0d369cde3 +Author: Ondrej Zajicek (work) +Date: Mon Mar 19 19:51:11 2018 +0100 + + C99 loop declarations not allowed in 1.6.x + +commit e8bc64e308586b6502090da2775af84cd760ed0d +Author: Jan Maria Matejka +Date: Wed Feb 28 16:57:50 2018 +0100 + + Filter: make bgpmask literals real constructors + + The bgpmask literals can include expressions. This is OK but they have + to be interpreted as soon as the code is run, not in the time the code + is used as value. + + This led to strange behavior like rewriting bgpmasks when they shan't + be rewritten: + + function mask_generator(int as) + { + return [= * as * =]; + } + + function another() + bgpmask m1; + bgpmask m2; + { + m1 = mask_generator(10); + m2 = mask_generator(20); + if (m1 == m2) { + print("strange"); # this would happen + } + } + + Moreover, sending this to CLI would cause stack overflow and knock down the + whole BIRD, as soon as there is at least one route to execute the given + filter on. + + show route filter bgpmask mmm; bgppath ppp; { ppp = +empty+; mmm = [= (ppp ~ mmm) =]; print(mmm); accept; } + + The magic match operator (~) inside the bgpmask literal would try to + resolve mmm, which points to the same bgpmask so it would resolve + itself, call the magic match operator and vice versa. + + After this patch, the bgpmask literal will get resolved as soon as it's + assigned to mmm and it also will return a type error as bool is not + convertible to ASN in BIRD. + +commit 74bfd2f97c0a95b6fb73a67d9334e54a90695c58 +Author: Jan Maria Matejka +Date: Tue Mar 13 12:08:37 2018 +0100 + + Filters: Removed FI_COMMA, not used for 19 years. + + This instruction was removed in the commit linked below + and never used ever again. Rest in peace. + + commit 84c7e1943f0dbf896b1dd8d02a21120aa00463f4 + Author: Pavel Machek + Date: Tue Mar 2 19:49:28 1999 +0000 + +commit 7c601e6b7b7696b24ce5f5715fa14dbb91c71d6e +Author: Jan Maria Matejka +Date: Wed Nov 29 11:38:01 2017 +0100 + + Filter: recursion to loop + + It was supposed to do tail-recursion in interpret() but it didn't + compile as such. Converting it to loop makes a significant filter + performance improvement for flat filters. + +commit 5a14df395053f4094a1e3ebea98e3487cbfc0e63 +Author: Maria Jan Matejka +Date: Thu Oct 19 12:39:44 2017 +0200 + + Filter: Instruction codes named as enum + + The two-letter instructions were quite messy but they could be easily + read from memory dumps. Now GDB (since 2012) supports pretty printing + enum values and GCC checks the switch construction for missing enum + values so we are converting the nice two-byte values to enums. + + Anyway, the enum still keeps the old two-byte values to be able to read + the instruction codes even without GDB from plain memory dump. + +commit 2d6d4b80539be13aa53c6751fb33689b263e4010 +Author: Ondrej Zajicek (work) +Date: Wed Mar 7 17:35:24 2018 +0100 + + Babel: Fix build with restricted protocol set + + All keywords used in Babel config have to be declared locally. + + Thanks to Leo Vandewoestijne for the bugreport. + +commit d6cf996151307d083c30e4ecde0f1d7449b19253 +Author: Ondrej Zajicek (work) +Date: Tue Jan 23 17:05:45 2018 +0100 + + IO: Fix socket priority + + On Linux, setting the ToS will also set the priority and the range of + accepted values is quite limited (masked by 0x1e). Therefore, 0xc0 is + translated to a priority of 0, not something we want, overriding the + "7" priority which was set previously explicitely. To avoid that, just + move setting priority later in the code. + + Thanks to Vincent Bernat for the patch. + +commit 63472779ad4ecdecbcfedf2d2bb40abc2f8c84b0 +Author: Ondrej Zajicek (work) +Date: Tue Jan 16 19:17:04 2018 +0100 + + BGP: Implement 'disable after cease' option + + The option allows to specify that some cease subcodes should + disable the protocol when received. + +commit b94057911554e04df9b709f8354e2e220131096a +Author: Ondrej Zajicek (work) +Date: Tue Jan 16 16:20:01 2018 +0100 + + Filter: Allow silent filter execution + + A filter should log messages only if executed explicitly (e.g., during + route export or route import). When a filter is executed for technical + reasons (e.g., to establish whether a route was exported before), it + should run silently. + +commit 0ff86d054efa8005c5df943acf6d2122781d3175 +Author: Ondrej Zajicek (work) +Date: Wed Jan 3 14:12:00 2018 +0100 + + ROA: Fix reconfiguration + +commit cce6ba4daa2e00d6e1881a831d05cdc51249b4a7 +Author: Ondrej Zajicek (work) +Date: Tue Jan 2 14:11:59 2018 +0100 + + Remove libhistory check + + According to GNU Readline developers, if we link with libreadline then + there is no need to link with libhistory at all. + +commit 8396094156c2ddae279ec9c265100e28acb65a8d +Author: Ondrej Zajicek (work) +Date: Thu Dec 14 22:15:01 2017 +0100 + + Minor cleanups + +commit 1e8721e2aeccfbc3f533e8b8abc07582cee77e9a +Author: Ondrej Zajicek (work) +Date: Tue Nov 28 19:33:33 2017 +0100 + + Babel: Parse flags in Hello TLV + + RFC6126bis introduces a flags field for the Hello TLV, and adds a unicast flag + that is used to signify that a hello was sent as unicast. This adds parsing of + the flags field and ignores such unicast hellos, which preserves compatibility + until we can add a proper implementation of the unicast hello mechanism. + + Thanks to Toke Hoiland-Jorgensen for the patch. + +commit 9ba4b4a63d27943586b76574b7f310ee532509a3 +Author: Jan Maria Matejka +Date: Thu Nov 9 15:04:05 2017 +0100 + + Filter test: typo fix + +commit d9573a40ecaf9758690e4482782bebaf7847ba9b +Author: Ondrej Zajicek (work) +Date: Tue Oct 10 15:06:39 2017 +0200 + + Doc: Update sgml2* tools + + The old ones do not work on current Debian. + +commit 7e8d6116df68e96ef4abd64f6b9cbe7406c5985d +Author: Ondrej Zajicek (work) +Date: Tue Oct 10 13:27:03 2017 +0200 + + Doc: Fix reference + +commit 18352188ed7415ddb3aa7b0d7a2fc16d57a2d5d2 +Author: Michal 'vorner' Vaner +Date: Tue Sep 19 17:23:31 2017 +0200 + + RAdv: Documentation for more specific routes + +commit 7c0bab3a3987b42bc699c4417c7b2e838f189158 +Author: Ondrej Zajicek (work) +Date: Fri Oct 6 12:22:18 2017 +0200 + + RAdv: Change specific route options to be per-interface + + And change default values of specific route options to be consistent with + values of default router options. + +commit 2a95e63343a94243745e5d7000bb3e0cb61a4a0f +Author: Michal 'vorner' Vaner +Date: Thu Aug 31 15:40:23 2017 +0200 + + RAdv: Support for more specific routes (RFC 4191) + + The patch implements Default Router Preferences and More-Specific Routes + (RFC 4191) for RAdv protocol, allowing to announce router preference and + more specific routes in router advertisements. Routes can be exported to + RAdv like to regular routing protocols. + + Some cleanups, bugfixes and other changes done by Ondrej Zajicek. + +commit 5a8b1fb047d675badc17ab24175d0db06d7cc00c +Author: Michal 'vorner' Vaner +Date: Tue Sep 5 15:50:00 2017 +0200 + + filter: Allow assigning enums into extended attributes + + They are internally ints, but they got refused as a wrong type. This + fixes setting of the BGP origin and is also needed for RA. + +commit cd1d99611e445c9fe2452d05627ccfc624f35c39 +Author: Ondrej Zajicek (work) +Date: Tue Sep 19 19:55:37 2017 +0200 + + BGP: Shutdown communication (RFC 8203) + + The patch implements BGP Administrative Shutdown Communication (RFC 8203) + allowing BGP operators to pass messages related to BGP session + administrative shutdown/restart. It handles both transmit and receive of + shutdown messages. Messages are logged and may be displayed by show + protocol all command. + + Thanks to Job Snijders for the basic patch. + +commit 7b2c5f3d2826e3175bf31b1c36056c9efc587a2b +Author: Michal 'vorner' Vaner +Date: Thu Sep 14 12:31:15 2017 +0200 + + Docs: FIB iteration macros + +commit 18ea2ea759963a68a1a9f82d50aa9ed90b128df9 +Author: Ondrej Zajicek (work) +Date: Wed Sep 13 13:10:50 2017 +0200 + + Doc: Document 'empty' operator + + Thanks to Alexander Zubkov for the notification. + +commit f2dd602fef2ecf0a6598b817d71ce2ee8fadd5cc +Author: Ondrej Zajicek (work) +Date: Tue Sep 12 16:33:29 2017 +0200 + + Backport some minor changes from int-new + +commit 9f4908fe78cb3e5191bca721588ee1acb10876e3 +Author: Ondrej Zajicek (work) +Date: Tue Sep 12 15:49:36 2017 +0200 + + Nest: VRF support for neighbor cache and olock code + + Actually much simpler than expected. + +commit 943478b00f585725c3e7406909ee867dcfac5f87 +Author: Ondrej Zajicek (work) +Date: Wed Sep 6 17:38:48 2017 +0200 + + Basic VRF support + + Add basic VRF (virtual routing and forwarding) support. Protocols can be + associated with VRFs, such protocols will be restricted to interfaces + assigned to the VRF (as reported by Linux kernel) and will use sockets + bound to the VRF. E.g., different multihop BGP instances can use diffent + kernel routing tables to handle BGP TCP connections. + + The VRF support is preliminary, currently there are several limitations: + + - Recent Linux kernels (4.11) do not handle correctly sockets bound + to interaces that are part of VRF, so most protocols other than multihop + BGP do not work. This will be fixed by future kernel versions. + + - Neighbor cache ignores VRFs. Breaks config with the same prefix on + local interfaces in different VRFs. Not much problem as single hop + protocols do not work anyways. + + - Olock code ignores VRFs. Breaks config with multiple BGP peers with the + same IP address in different VRFs. + + - Incoming BGP connections are not dispatched according to VRFs. + Breaks config with multiple BGP peers with the same IP address in + different VRFs. Perhaps we would need some kernel API to read VRF of + incoming connection? Or probably use multiple listening sockets in + int-new branch. + + - We should handle master VRF interface up/down events and perhaps + disable associated protocols when VRF goes down. Or at least disable + associated interfaces. + + - Also we should check if the master iface is really VRF iface and + not some other kind of master iface. + + - BFD session request dispatch should be aware of VRFs. + + - Perhaps kernel protocol should read default kernel table ID from VRF + iface so it is not necessary to configure it. + + - Perhaps we should have per-VRF default table. + +commit 98bb80a243b58c43453e9be69d19d0350286549c +Author: Ondrej Zajicek (work) +Date: Tue Sep 5 00:02:20 2017 +0200 + + KRT: Fix IPv6 ECMP handling with Linux 4.11+ + + Starting from Linux 4.11, IPv6 ECMP routes are now notified using + RTA_MULTIPATH, like IPv4 ones. The patch adds support for RTA_MULTIPATH + parsing for IPv6 routes. This also enables to parse ECMP alien routes + correctly. + + Thanks to Vincent Bernat for the original patch. + +commit 9befc7cc4f26889077ace537019de92903139133 +Author: Ondrej Zajicek (work) +Date: Mon Sep 4 22:32:45 2017 +0200 + + BSD: Fix alignment issue + + Incorrect structure alignment breaks kernel routing table updates on + FreeBSD/ARM (and perhaps other platforms). + + Thanks to Eugene Sevastyanov for the original patch. + +commit 96eace1ea70d7c2bc13672fbeba104d34d8ede4c +Merge: 08b6a61 5c4dfe0 +Author: Michal 'vorner' Vaner +Date: Mon Sep 4 13:30:13 2017 +0200 + + Merge branch 'gitlab-ci' + +commit 5c4dfe0c30e5516fac73e6ed8455af2245ebc62a +Author: Michal 'vorner' Vaner +Date: Thu Aug 17 15:02:35 2017 +0200 + + Gitlab CI support + + Add configuration and docker definitions for tests and builds in Gitlab + CI platform. + + Some of them currently fail, which is a known problem. + +commit 08b6a617e862ffc7b7460abb79fe4c198806517c +Author: Ondrej Zajicek (work) +Date: Tue Aug 29 19:17:35 2017 +0200 + + RAdv: Some style nitpicks + +commit ec7d6a506ecae89e5019ce7fcb380a713be28bce +Author: Michal 'vorner' Vaner +Date: Thu Aug 17 11:34:25 2017 +0200 + + RAdv: Configure how long a dead prefix is advertised + +commit e2d2b3ef21f082a034e79d0880d4b36428029a59 +Author: Michal 'vorner' Vaner +Date: Fri Aug 11 12:25:36 2017 +0200 + + RAdv: Buffer prefixes awhile after they disappear + + Keep a cache of all the relevant prefixes we send out. When a prefix + appears, insert it into the cache. If it dies, keep it there for a + while, marked as dead. + + Send out the dead prefixes with zero lifetime. + +commit 3ac5d1ce4c10719dd48555521a50d4a9c5eadd15 +Author: Michal 'vorner' Vaner +Date: Wed Aug 9 16:00:16 2017 +0200 + + RAdv: Extract prefix option preparation + + Put the prefix option preparation into a separate function. We're going + to reuse that bit of code. + +commit e7ed9ecba77162b4c09f34354378b0e752b9078e +Author: Ondrej Zajicek (work) +Date: Tue Aug 22 14:03:38 2017 +0200 + + Client: Fix include + +commit 080d9e4ce25f8f14e61ba0a81d5385bf8de3e48f +Author: Michal 'vorner' Vaner +Date: Thu Aug 10 14:35:14 2017 +0200 + + Nicer log output + + non-primary is ugly, just omit it (and use primary in the other case). + +commit 5699a2036cfb32cb3a683814f83242eb21e40d02 +Author: Michal 'vorner' Vaner +Date: Thu Aug 10 13:06:05 2017 +0200 + + Less confusing log message + + A non-primary address isn't necessarily secondary, that's an independent + flag. + +commit 9b776458efdfae0c30b97f3670a1f4646221f072 +Author: Michal 'vorner' Vaner +Date: Wed Aug 9 13:39:20 2017 +0200 + + Gitignore: File created by autoreconf + +commit da390bb11c8efc70767fc4b6d00bebf558d3b00f +Author: Michal 'vorner' Vaner +Date: Wed Aug 9 13:35:55 2017 +0200 + + Drop stale TODO + + A TODO file last updated 5 years ago is useless. + +commit b3fae3a81796b6deea48445402793660fade5eb6 +Author: Ondrej Zajicek (work) +Date: Wed Aug 9 12:41:44 2017 +0200 + + RAdv: Fix typo + +commit 1f182675c816e4708312f99dd817fb894f3a90b3 +Author: Michal 'vorner' Vaner +Date: Tue Aug 8 14:40:51 2017 +0200 + + RAdv: Style updates + + Adapt the naming conventions to be a bit closer to the other protocols. + + proto_radv -> radv_proto + struct radv_proto *ra -> struct radv_proto *p + struct proto *p -> struct proto *P + +commit 637ed49868c56c0e05467f0e0ddb6aa1231deaa4 +Author: Michal 'vorner' Vaner +Date: Fri Aug 4 10:52:57 2017 +0200 + + radv: Fix RFC reference in comments + +commit e46128fb50e108e8cfdf6bb6e9ab040e00f5dfdc +Author: Ondrej Zajicek (work) +Date: Mon Jun 19 12:46:40 2017 +0200 + + Filters: Do not clamp EC set values to 16 bit for EC_GENERICs + + Thanks to Lennert Buytenhek for the patch. + +commit 33f7fbc42d0490b27e33275d0fc74d3ef55683e4 +Author: Ondrej Zajicek (work) +Date: Wed May 31 13:31:03 2017 +0200 + + CLI: Fix bug in symbol handling introduced in previous patches + +commit 4fec43067e27c7a6c20a6ef9909bef0238984a64 +Author: Ondrej Zajicek (work) +Date: Tue May 30 14:43:49 2017 +0200 + + Workaround for older bisons + +commit b7761af34dc4ed3f1bdf874eb85d743b931b0af6 +Author: Ondrej Zajicek (work) +Date: Thu May 25 23:30:39 2017 +0200 + + Conf: Replace keyword and symbol hash table with generic hash table. + + The old hash table had fixed size, which makes it slow for config files + with large number of symbols and symbol lookups. The new one is growing + according to needs. + +commit c72b660b7423b0fb687794b722884cd6e5e6c562 +Author: Ondrej Zajicek (work) +Date: Tue May 23 18:39:20 2017 +0200 + + Client: Fix isspace() calls + + Function isspace() expects to get *unsigned* chars (encoded as ints), + not that it matters for plain ASCII. + +commit 78e4dac993ad018bee98e245f6e858e18cc5db8a +Author: Ondrej Zajicek (work) +Date: Thu May 18 14:26:57 2017 +0200 + + Fix some forgotten warnings + +commit d6e01ff90024fcee259eb145f38a0f5b000e4798 +Author: Ondrej Zajicek (work) +Date: Wed May 17 17:30:23 2017 +0200 + + Fix of the previous commit + +commit dab6706abad3be5b8efd44fe860689df44d20e83 +Author: Ondrej Zajicek (work) +Date: Wed May 17 17:03:36 2017 +0200 + + History lib may be integrated to Readline lib + +commit 81edd3b3a78265b87c2ec6100dce852db5f40d2b +Author: Ondrej Zajicek (work) +Date: Wed May 17 16:05:07 2017 +0200 + + Fix build on systems with dirty headers + +commit a01e951d0fa452fea10a9faca0fbdc9c7cacff23 +Author: Ondrej Zajicek (work) +Date: Wed May 17 13:17:40 2017 +0200 + + One more configure cleanup + + Simplify BIRD client library checks, add proper devel header checks and + prefer dependency on just tinfo than full ncurses. + +commit b845ea097c285f17641d60df3dea4d3e820a1475 +Author: Ondrej Zajicek (work) +Date: Thu May 11 01:29:39 2017 +0200 + + Remove autoconf macros for time_t and alignment + + Replaced by constant compile-time expressions. CPU_STRUCT_ALIGN is not + really correct, but is consistent with the old behavior. + +commit b81a73d1fbddda4c319899910d751215ff3d29ca +Author: Ondrej Zajicek (work) +Date: Tue May 9 18:58:22 2017 +0200 + + Minor autoconf cleanups + + Make indentation and quotation consistent in configure macros. + Also remove --with-sysinclude option, which was broken for 7 years + and nobody complained. + + Thanks to Ruben Kerkhof for source patches. + +commit e40542ef3a415d163a5ff5fee26c888fead79fa6 +Author: Ondrej Zajicek (work) +Date: Tue May 9 16:46:41 2017 +0200 + + Minor autoconf cleanup and documentation update + +commit c253ec3a9c45cfce3661f38bc2f5156d4bdd7969 +Author: Ondrej Zajicek (work) +Date: Tue May 9 13:44:02 2017 +0200 + + Some more autoconf cleanups + + Replace integer type width detection with C99 fixed-width types. + Also remove some unused or obsolete code. + + Thanks to Ruben Kerkhof for the patchset. + +commit 7a855725f2ffde508da0c7ee01dc1bcd6e0a5d93 +Author: Ondrej Zajicek (work) +Date: Tue Mar 14 13:46:51 2017 +0100 + + Some autoconf cleanups + + The patch allows to use autoreconf, replaces some long obsolete + constructs and does some other minor cleanups. Also, the file + configure.in is renamed to configure.ac, as the old name has been + deprecated for a long time. + + Thanks to Ruben Kerkhof for the patchset. + +commit 33b6c292c3e3a8972d0b9f43d156aae50db65720 +Author: Ondrej Zajicek (work) +Date: Tue Mar 14 12:56:47 2017 +0100 + + BGP: Allow to specify interface for regular sessions + + This may be useful if multple interfaces share the same network range. + + Thanks to Fritz Grimpen for the original patch. + +commit 27f6ba651ebb07201f7964c8f14a254267f0f26a +Author: Ondrej Zajicek (work) +Date: Sat Mar 11 16:21:28 2017 +0100 + + BGP: Fix bug in ADD_PATH + + When a BGP session with ADD_PATH is restarted and the neighbor do not + announce ADD_PATH capability during reconnect, the accept_ra_types is + still set to RA_ANY. + + Thanks to Lennert Buytenhek for the bugreport + +commit 1950a479c020d1972b6007d8ea0f66e3d4f8564a +Author: Ondrej Zajicek (work) +Date: Thu Feb 23 16:32:07 2017 +0100 + + BGP: Allow exchanging LOCAL_PREF with eBGP peers + + Adds option 'allow bgp_local_pref' to override the usual restriction of + LOCAL_PREF on eBGP sessions. + + Thanks to Lennert Buytenhek for the patch. + +commit 4e379bde60172823452cf96e9c0b6b1737c490f0 +Author: Ondrej Zajicek (work) +Date: Sun Feb 19 12:02:39 2017 +0100 + + BGP: Update RFC references + +commit 9be12a7d95d668a64922f935057c0b401b58ab75 +Author: Ondrej Zajicek (work) +Date: Sun Feb 19 11:25:16 2017 +0100 + + Doc: Fix RIP example + + Thanks to Steve Leung for the bugreport. + +commit 30c734fc73648e4c43af4f45e68ac2de3d7ddea1 +Author: Ondrej Zajicek (work) +Date: Fri Feb 17 22:54:06 2017 +0100 + + Static: Fix bug in static route filter expressions + + During reconfiguration, old and new filter expressions in static routes + are compared using i_same() function. When filter expressions contain + function calls, it is necessary that old filter expressions are the + second argument in i_same(), as it is internally modified by i_same(). + Otherwise pointers to old (and freed) data appear in the config + structure. + + Thanks to Lennert Buytenhek for tracking and reporting the bug. + +commit da65a3d898fde0ce567782d86919a66e29916ed7 +Author: Ondrej Zajicek (work) +Date: Tue Jan 24 15:35:38 2017 +0100 + + Filter: Fix missing case for !~ operator + + Thanks to Vincent Bernat for the patch. + +commit f6e6c3b5a5997ffc67d96785bbde76bcec072890 +Author: Ondrej Zajicek (work) +Date: Tue Jan 17 13:21:25 2017 +0100 + + Fix IP_HDRINCL usage on FreeBSD 11 + + FreeBSD 11 changed endianity of ip_len field from host order to network + order. Also DragonFly BSD allegedly expects network order here. + + Thanks to Olivier Cochard-Labbé for the patch. + commit 017da76b729cc36c4a3416995b06386235660f42 Author: Ondrej Zajicek (work) Date: Wed Dec 21 16:46:47 2016 +0100 diff -Nru bird-1.6.3/client/client.c bird-1.6.4/client/client.c --- bird-1.6.3/client/client.c 2016-12-22 22:53:39.000000000 +0000 +++ bird-1.6.4/client/client.c 2017-12-11 07:33:26.000000000 +0000 @@ -25,9 +25,10 @@ #include #include #include +#include #include -#include #include +#include #include "nest/bird.h" #include "lib/resource.h" diff -Nru bird-1.6.3/client/commands.c bird-1.6.4/client/commands.c --- bird-1.6.3/client/commands.c 2016-12-22 22:53:39.000000000 +0000 +++ bird-1.6.4/client/commands.c 2018-03-24 14:57:53.000000000 +0000 @@ -36,6 +36,8 @@ static struct cmd_node cmd_root; +#define isspace_(X) isspace((unsigned char) (X)) + void cmd_build_tree(void) { @@ -53,7 +55,7 @@ while (*c) { char *d = c; - while (*c && !isspace(*c)) + while (*c && !isspace_(*c)) c++; for(new=old->son; new; new=new->sibling) if (new->len == c-d && !memcmp(new->token, d, c-d)) @@ -71,7 +73,7 @@ new->prio = (new->len == 3 && (!memcmp(new->token, "roa", 3) || !memcmp(new->token, "rip", 3))) ? 0 : 1; /* Hack */ } old = new; - while (isspace(*c)) + while (isspace_(*c)) c++; } if (cmd->is_real_cmd) @@ -132,7 +134,7 @@ struct cmd_node *m; for(m=root->son; m; m=m->sibling) - if (m->len > len && !memcmp(m->token, cmd, len)) + if (m->len > len && !memcmp(m->token, cmd, len)) cmd_display_help(m->help, m->cmd); } @@ -147,13 +149,13 @@ n = &cmd_root; while (cmd < end) { - if (isspace(*cmd)) + if (isspace_(*cmd)) { cmd++; continue; } z = cmd; - while (cmd < end && !isspace(*cmd)) + while (cmd < end && !isspace_(*cmd)) cmd++; m = cmd_find_abbrev(n, z, cmd-z, &ambig); if (ambig) @@ -222,20 +224,20 @@ int ambig, cnt = 0, common; /* Find the last word we want to complete */ - for(fin=end; fin > start && !isspace(fin[-1]); fin--) + for(fin=end; fin > start && !isspace_(fin[-1]); fin--) ; /* Find the context */ n = &cmd_root; while (cmd < fin && n->son) { - if (isspace(*cmd)) + if (isspace_(*cmd)) { cmd++; continue; } z = cmd; - while (cmd < fin && !isspace(*cmd)) + while (cmd < fin && !isspace_(*cmd)) cmd++; m = cmd_find_abbrev(n, z, cmd-z, &ambig); if (ambig) @@ -290,13 +292,13 @@ n = &cmd_root; while (*c) { - if (isspace(*c)) + if (isspace_(*c)) { c++; continue; } b = c; - while (*c && !isspace(*c)) + while (*c && !isspace_(*c)) c++; m = cmd_find_abbrev(n, b, c-b, &ambig); if (!m) diff -Nru bird-1.6.3/conf/cf-lex.l bird-1.6.4/conf/cf-lex.l --- bird-1.6.3/conf/cf-lex.l 2016-12-22 22:53:39.000000000 +0000 +++ bird-1.6.4/conf/cf-lex.l 2018-03-24 14:57:53.000000000 +0000 @@ -48,6 +48,7 @@ #include "conf/conf.h" #include "conf/cf-parse.tab.h" #include "lib/string.h" +#include "lib/hash.h" struct keyword { byte *name; @@ -57,21 +58,36 @@ #include "conf/keywords.h" -#define KW_HASH_SIZE 64 -static struct keyword *kw_hash[KW_HASH_SIZE]; -static int kw_hash_inited; - -#define SYM_HASH_SIZE 128 - -struct sym_scope { - struct sym_scope *next; /* Next on scope stack */ - struct symbol *name; /* Name of this scope */ - int active; /* Currently entered */ -}; -static struct sym_scope *conf_this_scope; +/* Could be defined by Bison in cf-parse.tab.h, inteferes with SYM hash */ +#ifdef SYM +#undef SYM +#endif + + +static uint cf_hash(byte *c); + +#define KW_KEY(n) n->name +#define KW_NEXT(n) n->next +#define KW_EQ(a,b) !strcmp(a,b) +#define KW_FN(k) cf_hash(k) +#define KW_ORDER 8 /* Fixed */ + +#define SYM_KEY(n) n->name, n->scope->active +#define SYM_NEXT(n) n->next +#define SYM_EQ(a,s1,b,s2) !strcmp(a,b) && s1 == s2 +#define SYM_FN(k,s) cf_hash(k) +#define SYM_ORDER 6 /* Initial */ -static int cf_hash(byte *c); -static inline struct symbol * cf_get_sym(byte *c, uint h0); +#define SYM_REHASH sym_rehash +#define SYM_PARAMS /8, *1, 2, 2, 6, 20 + + +HASH_DEFINE_REHASH_FN(SYM, struct symbol) + +HASH(struct keyword) kw_hash; + + +static struct sym_scope *conf_this_scope; linpool *cfg_mem; @@ -179,23 +195,20 @@ yytext[yyleng-1] = 0; yytext++; } - unsigned int h = cf_hash(yytext); - struct keyword *k = kw_hash[h & (KW_HASH_SIZE-1)]; - while (k) + + struct keyword *k = HASH_FIND(kw_hash, KW, yytext); + if (k) + { + if (k->value > 0) + return k->value; + else { - if (!strcmp(k->name, yytext)) - { - if (k->value > 0) - return k->value; - else - { - cf_lval.i = -k->value; - return ENUM; - } - } - k=k->next; + cf_lval.i = -k->value; + return ENUM; } - cf_lval.s = cf_get_sym(yytext, h); + } + + cf_lval.s = cf_get_symbol(yytext); return SYM; } @@ -257,13 +270,13 @@ %% -static int +static uint cf_hash(byte *c) { - unsigned int h = 13; + uint h = 13 << 24; while (*c) - h = (h * 37) + *c++; + h = h + (h >> 2) + (h >> 5) + ((uint) *c++ << 24); return h; } @@ -428,56 +441,27 @@ } static struct symbol * -cf_new_sym(byte *c, uint h0) +cf_new_symbol(byte *c) { - uint h = h0 & (SYM_HASH_SIZE-1); - struct symbol *s, **ht; - int l; - - if (!new_config->sym_hash) - new_config->sym_hash = cfg_allocz(SYM_HASH_SIZE * sizeof(struct keyword *)); - ht = new_config->sym_hash; - l = strlen(c); + struct symbol *s; + + uint l = strlen(c); if (l > SYM_MAX_LEN) cf_error("Symbol too long"); + s = cfg_alloc(sizeof(struct symbol) + l); - s->next = ht[h]; - ht[h] = s; s->scope = conf_this_scope; s->class = SYM_VOID; s->def = NULL; s->aux = 0; strcpy(s->name, c); - return s; -} - -static struct symbol * -cf_find_sym(struct config *cfg, byte *c, uint h0) -{ - uint h = h0 & (SYM_HASH_SIZE-1); - struct symbol *s, **ht; - if (ht = cfg->sym_hash) - { - for(s = ht[h]; s; s=s->next) - if (!strcmp(s->name, c) && s->scope->active) - return s; - } - if (ht = cfg->sym_fallback) - { - /* We know only top-level scope is active */ - for(s = ht[h]; s; s=s->next) - if (!strcmp(s->name, c) && s->scope->active) - return s; - } + if (!new_config->sym_hash.data) + HASH_INIT(new_config->sym_hash, new_config->pool, SYM_ORDER); - return NULL; -} + HASH_INSERT2(new_config->sym_hash, SYM, new_config->pool, s); -static inline struct symbol * -cf_get_sym(byte *c, uint h0) -{ - return cf_find_sym(new_config, c, h0) ?: cf_new_sym(c, h0); + return s; } /** @@ -494,7 +478,18 @@ struct symbol * cf_find_symbol(struct config *cfg, byte *c) { - return cf_find_sym(cfg, c, cf_hash(c)); + struct symbol *s; + + if (cfg->sym_hash.data && + (s = HASH_FIND(cfg->sym_hash, SYM, c, 1))) + return s; + + if (cfg->fallback && + cfg->fallback->sym_hash.data && + (s = HASH_FIND(cfg->fallback->sym_hash, SYM, c, 1))) + return s; + + return NULL; } /** @@ -509,7 +504,7 @@ struct symbol * cf_get_symbol(byte *c) { - return cf_get_sym(c, cf_hash(c)); + return cf_find_symbol(new_config, c) ?: cf_new_symbol(c); } struct symbol * @@ -522,7 +517,7 @@ for(;;) { bsprintf(buf, template, ++(*counter)); - s = cf_get_sym(buf, cf_hash(buf)); + s = cf_get_symbol(buf); if (s->class == SYM_VOID) return s; if (!perc) @@ -553,7 +548,7 @@ { if (sym->scope == conf_this_scope) cf_error("Symbol already defined"); - sym = cf_new_sym(sym->name, cf_hash(sym->name)); + sym = cf_new_symbol(sym->name); } sym->class = type; sym->def = def; @@ -563,15 +558,11 @@ static void cf_lex_init_kh(void) { - struct keyword *k; + HASH_INIT(kw_hash, &root_pool, KW_ORDER); - for(k=keyword_list; k->name; k++) - { - unsigned h = cf_hash(k->name) & (KW_HASH_SIZE-1); - k->next = kw_hash[h]; - kw_hash[h] = k; - } - kw_hash_inited = 1; + struct keyword *k; + for (k=keyword_list; k->name; k++) + HASH_INSERT(kw_hash, KW, k); } /** @@ -585,7 +576,7 @@ void cf_lex_init(int is_cli, struct config *c) { - if (!kw_hash_inited) + if (!kw_hash.data) cf_lex_init_kh(); ifs_head = ifs = push_ifs(NULL); @@ -644,24 +635,6 @@ ASSERT(conf_this_scope); } -struct symbol * -cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos) -{ - for(;;) - { - if (!sym) - { - if (*pos >= SYM_HASH_SIZE) - return NULL; - sym = cf->sym_hash[(*pos)++]; - } - else - sym = sym->next; - if (sym && sym->scope->active) - return sym; - } -} - /** * cf_symbol_class_name - get name of a symbol class * @sym: symbol diff -Nru bird-1.6.3/conf/confbase.Y bird-1.6.4/conf/confbase.Y --- bird-1.6.3/conf/confbase.Y 2016-12-22 22:53:39.000000000 +0000 +++ bird-1.6.4/conf/confbase.Y 2018-03-24 14:57:53.000000000 +0000 @@ -43,6 +43,8 @@ char *t; struct rtable_config *r; struct f_inst *x; + struct f_dynamic_attr fda; + struct f_static_attr fsa; struct filter *f; struct f_tree *e; struct f_trie *trie; @@ -77,7 +79,7 @@ %type