doc: update some introduction paragraphsin particular,
- add IS-IS to some listings
- list Solaris & OSX as "some work required"
- remove OS version numbers. We have no base to specify any of them.
- list supported C compilers (gcc, clang, icc)
- cut the Quagga 2.0 stuff that promises QoS and firewall functionality
bgpd: fix crash in soft-reconfigurationCommit 8692c50652 introduced a bug where bgpd would crash on
soft-reconfiguration.
This happens e.g. when there are filtered unicast routes because
rn->info is NULL in that case, which the code did not account for.
Reported-by: Paweł Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
tests: fix missing init in bgp_mp_attr_test.cturns out, bgp_mp_reach_parse really doesn't like getting garbage
attribute input. In particular, attr->extra better be NULL or we
merrily go trample random places (like our stack).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
tests: update & extend AS_PATH testsNB: these tests test for current implementation state, not for RFC
conformance. In particular, behaviour with confederations in AS4_PATH
as well as reconcilation of short AS_PATH + AS4_PATH is currently NOT
conforming to RFC 4893/6793.
* tests/aspath_test.c: add capability to put both AS4_PATH & AS_PATH,
add test for AS4_PATH w/o AS_PATH, update confederation test
Signed-off-by: David Lam...
bgpd: relax ORF capability length handlingcommit fe9bb64... "bgpd: CVE-2012-1820, DoS in bgp_capability_orf()"
made the length test in bgp_capability_orf_entry() stricter and is now
causing us to refuse (with CEASE) ORF capabilites carrying any excess
data. This does not conform to the robustness principle as laid out by
RFC1122 ("be liberal in what you accept").
Even worse, RFC5291 is quite unclear on how to use the ORF capability
w...
bgpd: don't try to reconcile AS4_PATH with NULLbgp_attr_munge_as4_attrs would previously try to reintegrate an AS4_PATH
with a NULL AS_PATH, leading to a rather nasty SEGV. Let's go by
RFC6793 and treat missing AS_PATH as 0-length AS_PATH, which in turn
means discarding the AS4_PATH.
[NB: we don't actually stick to the actual rule, which is discarding
AS4_PATH if it's longer than AS_PATH; indeed we should probably fix that
too]
Signed-of...
build: Quagga 0.99.22-rc1this is not a full release version, so neither release notes nor
documentation are updated yet. Also, signing the tag with my private
GPG key instead of the Quagga one.
bgpd: conditional default-originate using route-mapIncorporate a patch by Svetozar Mihailov which implements
default-originate route-maps to behave as expected, i.e. allowing
the default route to be advertised conditionally, depending on a
criterion given by the route-map.
I am aware that the performance attributes of the following implementation
are far from optimal. However, this affects only code paths belonging to
a feature that is broken ...
bgpd: uncork/nagle socket when sending BGP NOTIFYThis pushes out the NOTIFY message before closing a connection.
Previously, the TCP_CORK bandwidth optimization code caused NOTIFY
messages to disappear prior to when the connection is closed.
* bgpd/bgp_packet.c: unset CORK, set NODELAY, and replace
writen() by more correct write()
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Revert "bgpd: flock() dump files (BZ#742)"This reverts commit b07458a055493dd37cb955ae90f11ae8bc334d3a.
On second thought, the right way to do this is with rename(), not by
introducing a lock that can potentially even stall bgpd.
Reported-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: fix sockaddr_dl length assumptions (BZ#737)Quagga makes bad assumptions about sockaddr_dl (on NetBSD, but possibly
on other systems as well). Particularly, sizeof(struct sockaddr_dl)
returns a size that does not include the full sdl_data field, leading to
not enough data being copied. This breaks IPv6 RAs in particular, as
a broken mac address from sockaddr_dl will be included in the packets.
From: Matthias-Christian Ott <ott@mirix.o...
build: add buildtest.sh scriptThis script compiles Quagga in a variety of configurations and
optionally with LLVM and ICC (if those are installed).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
build: Fix build on MacOSX 10.8 (Mountain Lion)Newer MacOSX versions have support for both IPv6 advanced socket API
RFCs (2292 and 3542) switchable in compile time, but neither of these
is default for some strange reason. RFC3542 will be default in future,
but for now we have to declare that we want to use the RFC3542 API
before including <netinet/in.h>.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
build: Remove deprecated AM_CONFIG_HEADERAM_CONFIG_HEADER has been deprecated for many years and is removed
completely from automake 1.13.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: uncork after each writeKeep data flowing, uncork after each BGP_WRITE_PACKET_MAX.
This makes TCP send data sooner, since thread may not be scheduled
again for a a longish time because of new UPDATE's coming in.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: use recent monotonic time for readtimeThe readtime value is for diagnostic, and doesn't have to be highly
accurate. This also fixes a problem where the readtime was being measured
with system clock, but the peer_uptime() was comparing with bgp_clock.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
configure: allow building without getrusageMeasuring the resource usage of threads is moderately expensive
since it requires doing an additional system call everytime a
thread context switches. Make it possible to disable this with
a configuration option.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: mark route nodes scheduled into work queueThe flag bit BGP_NODE_PROCESS_SCHEDULED is checked but never set.
This causes route node to be scheduled multiple times under load.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: improve logging of invalid BGP NotificationsInvalid BGP Notification messages should be logged locally, cf.
RFC4271, Sect. 6.4, p 34,
NOTIFICATION Message Error Handling
Current notification for invalid Notification code:
2012/10/10 02:17:54 BGP: message index 10 not found in bgp_notify_msg (max is 8)
2012/10/10 02:17:54 BGP: 192.168.1.1 received NOTIFICATION 10/0 ((no item found)) 0 bytes
the logging should be a bit more clear....
bgpd: fix error response to invalid BGP version numberBGP4-ANVL 20.1 ANVL tries to open BGP with version 5 and expects correct
notification in response. Quagga sends notification, but with incorrect
information in it.
The data needs to be a 2-byte value, and for now we respond with 0004 for any
peer version other than 4.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: fix a bug in bgp_attr_dupCommit 558d1fec11749d3257e improved bgp_attr_dup so it would be possible
for the caller to provide attr_extra, allowing to use the stack instead
of the heap for operations requiring only a short lived attr.
However, this commit introduced a bug where bgp_attr_dup wouldn't copy
attr_extra at all (but provide a reference to the original) if the
caller provided attr_extra.
Cc: Jorge Boncompte [D...
bgpd: fix a memleak on "set community none"Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: don't overrun afi/safi array boundarieszebra was not checking afi/safi values. This was leading to crashes where
these values were coming directly from some protocol's on-wire fields.
Safeguarding them in zebra is a good start.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: store "no neighbor activate" for IPv4 unicastIf a neighbor was in a peer group for any AFI/SAFI, bgpd would never write a
"no neighbor activate" line for IPv4 unicast, so a valid setup like following
could be configured, but not saved:
router bgp 64600
bgp router-id 198.51.100.1
network 198.51.100.0/24
neighbor peers peer-group
neighbor 2001:db8::2 remote-as 64601
no neighbor 2001:db8::2 activate
!
a...
bgpd: avoid heap fragmentation in bgp_clear_route_tableIn bgp_clear_route_table, moved cleanup code before the allocation
of the work queue items. This returns the memory to the system
allocator before allocating new and might therefore help avoiding
heap fragmentation.
* bgp_route.c: (bgp_clear_route_table) moved code blocks.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Reviewed-by: Leonid Rosenboim <Leonid.Rosenboim@windriver.com>
Sig...
bgpd: fix for leaked struct bgp_adj_[in|out] on peer shutdown If a peer with soft-reconfiguration configured is cleared, the
function bgp_clear_route_table() doesn't free the bgp_adj_in and bgp_adj_out
structures of route nodes that for some reason, ej. denied by a filter,
don't have routes attached "rn->info == NULL".
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Reviewed-by: Leonid Rosenboim <Leonid.Rosenboim@windriver.com>
Signed-off-by: ...
lib: remove ALL_LIST_ELEMENTS dead code branchALL_LIST_ELEMENTS is checking node == NULL twice, which is causing a
whole slew of false positives in Coverity. In this particular case,
addressing this in the code is reasonable; being a macro, this appears
all over the place without easy remedy.
Acked-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: fix netlink NL_PKT_BUF_SIZEChange default value of variable NL_PKT_BUF_SIZE to 8192UL. Cf.
NLMSG_GOODSIZE definition of linux in include/linux/netlink.h for detail.
Previously, on platforms with a page size greater than 8192, if you had added
too many interfaces, zebra would not have enough buffer space to get the entire
interface list. This resulted in an incomplete interface list.
From: 高鹏 <gpstrive@gmail.com>
[upd...
build: Fix build for systems with no /bin/trueThere are systems with no /bin/true - it might have different path
(/usr/bin/true) or even a shell builtin.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
testzebra: pragma weak: detect systems with weak alias and provide alternativeLLVM clang does not support #pragma weak (bug 3679) on OS X. There are
other systems where the #pragma weak has varying syntax.
Added m4 file from the autoconf archives:
http://www.gnu.org/software/autoconf-archive/ax_sys_weak_alias.html
Fix up zebra/*_null.c files to use #pragma weak alias or stub functions
if not available. It's incomplete in that the different format #pragma
enable easier ...
ospfd: Remove dup MaxAge LSA floodStop additional, unnecessary flooding of MaxAge LSAs.
When a MaxAge LSA is installed, if the LSA is prematurely aged or the LSA is
not self-originated, the LSA is flushed. This results in a the LSA being
flooded a second time and in some cases flooded back to the receiver
(unless the receiver is also the advertising router). A MaxAge'd LSA has
already been flooded in ospf_flood() as part of th...
ospfd: Corrected ospfd Type-4/Type-5 ls update handlingThis fix is for Type-4 LS updates handling at a ABR router where
ospf daemon is not distributing Type-4 LS updates with correct LS-Age
after learning about a ASBR router in a ospf network. Because of this
Type-5 LS updates are not learnt in ospf network.
Testing Scenario:
This can be re-produced by restarting the ospfd daemon on DUT
(mentioned in figure below)before the Hello time interval expi...
ospfd: compile warning cleanupsA set of patches to clarify some comments as well as cleanup code that was
causing warnings. After these patches, the code can be compiled with
-Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings
-Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual
-Wextra -Wno-unused-parameter -Wno-missing-field-initializers
(what is current in trunk plus -Wextra -W...
ospfd: Changed TE instance check to remove -Wtype-limits warningSince LEGAL_TE_INSTANCE_RANGE() was being passed an unsigned int, a warning
was being thrown due to the compare against >= 0. Since this macro was used
only in one place, I removed the macro for an explict compare against a
constant for the MAX.
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
lib: Changes to VTY string-parsing macros to remove warningsThe VTY_GET_INTEGER_RANGE macro was being used also just to check the range
on a variable that wasn't used (for the "no" version of a VTY command), so I
split the macro into two. Also, since the variable is unsigned, if MIN is
zero, you get a warning about comparing an unsigned number against 0, giving
rise to slightly convoluted logic. Note that the previous two patches were
found by the -Wt...
ospfd: Fixed signed/unsigned masking of negative metricsIn the original code, negative metrics would be converted successfully by
atoi() and then converted to an unsigned int that would always compare
successfully against >= 0, leaving a large positive metric in the route map.
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfd: Fixed typo bug in ospf_vty.h:ospf_neighborTypo bug. ospf_nbr_nbma_poll_interval_set() was being sent priority instead
of interval.
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfd: fix argument parsing for distribute-listUse the correct argument for the protocol lookup in
ospf distribute-list commands.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf: fix apiserver enableThe ospf_apiserver_enable flag was being cleared _after_ the "-a"
command-line option set it to 1. Move up the initialisation, so
enabling the OSPF API is actually possible.
Reported-by: Rosario Mattera <rosmattera@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf: Fix type-4 network mask to 0 per RFCThe OSPF RFC (2328) states that the network mask field of a type 4
LSA "is not meaningful and must be zero". OSPFD has been setting
the mask as /32. This patch changes OSPFD to set the mask to 0 per
the RFC
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf: Reduce MaxAge log levelReduce the log level for the MaxAge LSA reception when such an LSA does
not exist in the database.
Signed-off-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf: Convert MAX_AGE LSA list to treeStore the MaxAge LSA list in a tree instead of a linked list for efficient access.
Walking the list can be quite inefficient in some large systems and under certain tests.
ospfd maintains the list of LSA's that have been MaxAge'd out in a separate
linked list for removal by a remover/walker thread. When a new LSA is to be
installed, the old LSA is ejected and when it is ejected, the MaxAge LSA...
ospf: forward ref. of areas for "max-metric router-lsa administrative" cmdIn the event areas are created at a later point of time with respect
to the playback of the "max-metric router-lsa administrative" command,
those areas do not get into indefinite max-metric mode. This patch is
inteneded to store the configuration and apply it to all future areas
that may be created.
In the process, some other bugs that were there with respect to restart
etc are fixed up.
Test...
ospf: suppress delete using replacementAfter a SPF run, OSPF deletes routes that have changed in terms of any
metric, type, and/or next-hops and re-adds them. Given that the Zebra-RIB
already support replacement semantics, we suppress deletes for routes
that will be added back again.
This has the following advantages. It reduces the number of IPC messages
between OSPF/Zebra. Also, in the current flow, a batch of route deletes
were ...