ripngd: add ECMP support* Each node in the routing table is changed into a list, holding
the multiple equal-cost paths.
* If one of the multiple entries gets less-preferred (greater
metric or greater distance), it will be directly deleted instead
of starting a garbage-collection timer for it.
The garbage-collection timer is started only when the last entry
in the list gets INFINITY.
* Some new functions ar...
lib: wrong #define used for IPV6_MINHOPCOUNTThe #define IPV6_MINHOPCNT define is never defined on any unix platform.
>From what I can tell the original implementation on the linux platform
was IPV6_MINHOPCNT, when it got accepted into the mainstream kernel
it was transformed into IPV6_MINHOPCOUNT. Since we test for the
define before attempting to use the code it was silently doing nothing
for a long time.
Signed-off-by: David Lamparter...
lib/privs: Don't use CAP_NET_BROADCASTFrom what I can tell, CAP_NET_BROADCAST has never been required for any
functionality in the Linux kernel, so we do not really need it.
However, it causes breakage in contexts where Quagga is started with a
limited set of capabilities, e.g. in Docker, because these may not
include CAP_NET_BROADCAST and in the case of Docker do not even support
adding CAP_NET_BROADCAST.
Signed-off-by: David La...
isisd: always print adj->sysid (clang 3.6 warning)As any new compiler version, clang 3.6 has new warnings, one of these
being that it now warns for testing whether the address of an array will
be true.
Of course there is no point in this check for the sysid, so let's always
just print the sysid.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty: don't clear output buffer on input EOFA VTY's input can be closed without the output becoming unavailable.
This happens both on stdio when stdin ends, as well as over TCP when an
unidirectional input shutdown() happens.
In such a case, resetting the output buffer is not appropriate since
there might still be data to be successfully written.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty: add vty_stdio at-close hookThis is intended to be used for either "exit on close", "fork on close"
or "reopen vty on close" functionality for the stdio vty. Which of
these options to take depends on the context, the use case right now is
test programs exiting on EOF.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty: put stdin in raw mode for vtyThe interactive CLI actually works just fine, if we just put the
terminal in raw mode to get keystrokes as they come.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty: add vty_stdio()this introduces a new public/API function to the vty code for opening a
VTY on stdin/stdout. Intended for unrestricted use by the individual
daemons, i.e. "offical API".
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty: add separate output fd support to VTYsto be used with stdin/stdout terminals, this adds support for writing to
a different FD than we're reading from. Also fixes error messages from
config load being written to stdin.
[v2: fixed config write]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh: fix the fix for babeld removal... (5460bae)Commit 5460bae ("*: fix 'babeld: Remove babeld from Quagga' (336724d)")
unfortunately removed the BABEL_NODE from vtysh, which now no longer
starts.
Fix by restoring the node (even though it won't be accessible).
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Fixes: 5460bae ("*: fix 'babeld: Remove babeld from Quagga' (336724d)")
Signed-off-by: David Lamparter <equinox@opensourcerou...
lib: fix "sockunion: add hash function" for BSD (9196caf)The sockunion_hash() function uses s6_addr32, which is not defined on
BSD systems. (It only works on glibc because we set _GNU_SOURCE)
ripngd/ripng_nexthop.h already contains a workaround for this. Bump
workaround to prefix.h so it's available everywhere.
Reported-by: NetDEF CI System <mwinter@netdef.org>
Fixes: 9196caf ("sockunion: add hash function")
Cc: Timo Teräs <timo.teras@iki.fi>
Sig...
bgpd: allow using rtt in route-map's set metricUseful when the BGP neighbors are over tunnels that have large
differences in geographic distances and RTTs. Especially useful
for DMVPN setups to allow preferring closes hub.
The parameter is added as new alias command as otherwise it seems
the command parser is not able to match it properly (it seems
merging is done for the various 'set metric' route-map objects in
different routing engines)...
sockopt: add support for querying tcp round-trip-timeSigned-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: refactor route-map objects modifying integer valuesUse common code to parse, validate and adjust the route-map
objects that contain a simple integer value. This also allows
compiling the add/sub format metric object.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
*: fix "babeld: Remove babeld from Quagga" (336724d)This removes some more bits of babeld, particularly from:
- buildtest.sh
- redhat/ build files
- vtysh integration (which actively broke the build)
The memtype and zclient/route type are kept in place since these don't
break anything and -theoretically- make it possible to build babeld
with some Quagga integration externally.
(Keeping vtysh integration is unfortunately not as easy.)
Reported-...
ospfd: Remove another odd flooding hack in opaque LSA code* ospf_opaque.c: (ospf_opaque_adjust_lsreq) Odd hack to general OSPF
database exchange but made to act only on opaque LSAs. It's either covering
up bugs in the flooding code or its wrong. If it's covering up bugs, those
would affect all LSAs and should be fixed at a lower layer in ospfd, indeed
perhaps those bugs are long fixed anyway (?). Alternatively, it's just plain
wrong. Nuke.
...
lib: assert(0) still needs a returnassert(0) is not guaranteed to not return since assert() in general can
be optimised out when building without debug / with optimisation. This
breaks the build in clang, which warns/errors about the missing return.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib: fix "reduce strcmp in CLI" fallout (10bac801)In "lib/cli: reduce strcmp in CLI hot paths", I failed to notice that
CMD_VARIABLE as a boolean test covers a superset of the other types of
variables. Thus, the patch broke processing of IP/IPv6/Integer range
parameters in the CLI.
Fix by some reordering and introducing TERMINAL_RECORD macro (which
marks whether a given terminal type is a parameter) to be used in places
where the check is re...
lib: straighten out ORF prefix list supportBGP ORF prefix lists are in a separate namespace; this was previously
hooked up with a special-purpose AFI value. This is a little kludgy for
extension, hence this splits it off.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Paul Jakma <paul@jakma.org>
lib: hide internal prefix list structuresThese are about to be touched and there's no point in other code
touching into prefix list's internas. Add some isolation.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: speed up "no-hit" withdraws for routeserversThis accelerates handling of incoming Withdraw messages for routes that
don't exist in the table to begin with. Cisco IOS 12.4(24)T4 has a bug
in this regard - it sends withdraws instead of doing nothing for
prefixes that are filtered.
Pulling up the adj_in removal in Quagga should have no ill effect, but
we can avoid the costly iteration over all rsclients if there was no
adj_in entry.
Perf...
ospfd: Remove the blocking of opaque LSAs origination & flooding 'optimisation'* Opaque support contains some kind of hack/optimisation to
origination/flooding to suppress some origins/floods until an opaque LS
Acks are received. Previous versions of the code have already been shown
to have bugs in them (see e16fd8a5, e.g.). It seems over-complex and fragile,
plus its conceptually the wrong place to try implement flooding hacks that,
AFAICT, do not depend parti...
ospfd: Make ospf_passive_interface_update calls friendly to static analysis* ospf_vty.c: ({no_}ospf_passive_interface_addr_cmd) To a static analyser,
the call to ospf_passive_interface_update can look like uninitialised memory
in addr might be read from. It won't be, as ospf_passive_interface_update
only reads addr if params != IF_DEF_PARAMS, but not clear. Split up the
helper into the two cases to make it clear.
lib/cli: reduce strcmp in CLI hot pathsEr, no idea how anyone could ever have thought that it would be a good
idea to have a zillion of strcmp() calls in the CLI's active paths, just
to compare against things like "A.B.C.D".
Reduces 40k prefix list load time from 1.65s to 1.23s (1.34:1).
Acked-by: Paul Jakma <paul@jakma.org>
[v2: killed CMDS_* macros]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib: constify sockunion apiAdd const to read-only api calls.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: fix rtadv check for non-glibc linuxDefault RTADV enabled for non-glibc linux (fixes check for musl libc).
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: fix build with rtadv disabledOtherwise we get warning on rtadv_init() prototype not being
defined when compiling rtadv.c (as dummy stub is provided always).
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
isisd: fix crash on processing own p2p helloisis_pdu.c :
isisd crashes if router's own p2p hello packets get processed
thereby creating an adjacecncy with itself. Asserts at
isis_find_vertex. So discard own p2p IIH PDU and avoid
creating adjacency with self. This would also fix duplicate
systemID on an interface. These checks already exists for IS-IS
LAN Level 1/2 Hello PDU in process_lan_hello, but not for
point-to-point IIH PDUs.
Sign...
HACKING: Use space char for indentation.* HACKING.tex: Whitespace/indent section is probably out of date. Rephrase.
Remove the editor recommendations, as I don't know what would be correct.
Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
gdb: Add a directory of files with gdb macros* gdb/: Directory to contain files with GDB macros. Organised by topic into
separate files.
* gdb/lib.txt: General OS API and Quagga lib macros:
(def_ntohs) convert big-endian short to host order.
(def_ntohl) convert big-endian long to host order.
(walk_route_table_next) Walk to next route_node in a table, according
to given top and current node arguments.
(walk_route_table) walk th...
Merge branch 'volatile/fix_warnings'Thanks to Donald Sharp and Greg Troxel for providing feedback!
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: fix NetBSD interface stats printf"format '%qu' expects type 'long long unsigned int', but argument 3 has
type '__uint64_t'"
Move to %llu, which is more standard.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
*: fix more initialisers (for BSD)FreeBSD and NetBSD spew a few more warnings about variable initialisers.
Found with OSR's/NetDEF's fancy new CI system.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
tests: fix warningsWhile I don't see -Werror being used on tests anytime soon, there's no
reason to keep the warnings in tests unfixed.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: silence zebra_serv_un unused warningzebra_serv_un() is unused if --enable-tcp-zebra is given.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
pimd: fix out of tree buildpimd/Makefile.am was missing srcdir/lib from its include paths, breaking
out-of-tree build regarding route_types.h
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
build: add --enable-werrorThis allows enabling -Werror in a consistent way. Note that this is
different from just specifiying it in CFLAGS, since that would either
break configure tests (if done on ./configure), or would override
configure's CFLAGS (if done on make).
Using --enable-werror instead provides a new WERROR variable that is
additionally used during make with a consistent set of warning flags.
The tests/ di...
build: determine CFLAGS more intelligentlyInstead of hardcoding some compiler detection, this just checks which
CFLAGS actually work with the compiler specified by the user.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: fix SNMP write supportThis code - dating back to the initial import in 2002 - probably never
worked. Calling asn_parse_int seems to always have been wrong, and in
the meantime, there no longer is a "struct variable *" argument for
write_method. If anyone tried to use it, it'd probably have crashed.
(I didn't try.)
Fix this up so it actually works. It's the only place in Quagga where a
SNMP write is actually supp...
snmp: fix warningsbatch-fix all warnings that come up when enabling AgentX SNMP support.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh: drop unused variables & RETSIGTYPEDrop unused return values in vtysh. Also gets rid of the rather funny
prototyping of signal setup in vtysh - which as a side effect makes it
not need AC_TYPE_SIGNAL in configure.ac anymore. It wasn't used
sensibly to begin with...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh: fix function prototypesThis makes a whole bunch of vtysh functions static, fixes prototypes for
a few more, and masks user_free() and user_write_config() (both unused.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh: don't use '\0' as NULLfor some reason, the vty code was using '\0' in place of NULL.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospf6d: fix pointer arithmetic warningcaddr_t was signed; this buffer size comparison is better done in
unsigned.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>