Don Slice [Wed, 10 Jan 2018 19:40:45 +0000 (19:40 +0000)]
bgpd: fix updating redist bitmask when vrf_id changes
Problem reported that when "systemctl restart networking" was
performed, prefixes previously redistributed into bgp from connected
were deleted from the bgp table. Determined that we were not correctly
changing the redistribution bitmask when the vrf_id of the vrf was
changed. This patch corrects that behavior.
Manual tests look good. bgp-min and vrf-min completed with no new failures.
Ticket: CM-19369 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Daniel Walton [Thu, 31 Aug 2017 16:58:38 +0000 (16:58 +0000)]
bgpd: 'summary' to show NoNeg if peer did not negotiate afi/safi
If we have configured neighbor 1.1.1.1 for an afi/safi but they have not
activated that afi/safi with us then display "NoNeg" in the state column
of the summary output. This is to make troubleshooting afi/safi
easier.
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Donald Sharp [Sat, 6 Jan 2018 19:04:35 +0000 (14:04 -0500)]
bgpd: Ensure that io thread is running after start
The BGP IO thread must be running before other threads
can start using it. So at startup check to see
that it running once, instead of before every
function call into.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Wed, 3 Jan 2018 18:58:53 +0000 (13:58 -0500)]
lib: fix a few bugs in ring buffers
* Fix rare failure caused when end pointer is at end of buffer memory
and a call to ringbuf_get() is made that reads all of the data in the
buffer; start pointer was advanced past end pointer, causing some
special handling to be skipped
* Fix ringbuf_peek() moving start pointer
* Fix use after free
* Remove extraneous assignment
* Update relevant tests
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Tue, 2 Jan 2018 14:47:38 +0000 (09:47 -0500)]
bgpd: Fix peer uptime display in milliseconds
For some reason bgp is calculating the peer uptime
in miliseconds incorrectly. Additionally we have
the peer_uptime function call that should be doing this!
But since we've choosen different names for the json output
we cannot fix it at this point.
uptime contains the number of seconds of uptime here. Just
multiply by 1k and display that( as peer_uptime does )
Fixes: #1585 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 3 Jan 2018 14:06:44 +0000 (09:06 -0500)]
pimd: Add finer grain return codes for configuration
When PIM handles some MSDP commands, a repeated command
was causing a CMD_WARNING_CONFIG_FAILED. This should
be a CMD_WARNING. Fix the code to allow vtysh to handle
this appropriately.
Ticket: CM-19053 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 2 Jan 2018 14:09:09 +0000 (09:09 -0500)]
zebra: Fix dest dereference
The rn can not have an rn->info pointer and as
such the dest may be NULL. Don't assign
the old_fib pointer if so. This is ok
because we know RNODE_FOREACH... will not
iterate if dest is NULL.
Fixes: #1575 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Chirag Shah [Thu, 28 Dec 2017 19:12:35 +0000 (11:12 -0800)]
ospf6d: Fix ospf6 redist with route-map
When ospf6 configure with redistribute connected/protocol
with route-map. Upon restart of frr.service, ospf6 receives
redistribute update then route-map update.
During redistribute route update, since route-map info is not
filled, route is suppressed from injected as external route.
Fix: reset redistribute when route-map update received
matches with redistribution (type) and route-map name.
Ticket:CM-13800
Testing Done:
Configure ospf6 redistribute with route-map to inject
Type-2 external routes into database. Trigger frr restart
redistribute with route-map happens.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Quentin Young [Tue, 26 Dec 2017 23:47:19 +0000 (18:47 -0500)]
lib: add ringbuf_peek()
Peek functionality for ring buffers and associated tests.
Also:
* Slight optimization to avoid 0-byte memcpy() by changing > to >=
* Add rv checks for some ringbuf_[put|get] calls that were missing them
in the test
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Don Slice [Mon, 18 Dec 2017 15:40:56 +0000 (10:40 -0500)]
bgpd: convert network statements from DEFUN to DEFPY
Problems reported with inconsistent use of parameters for bgp network
statements. Converted 12 DEFUNs to 2 DEFPY statements, making the
parameter use consistent with the exception of keeping the "backdoor"
keywork ipv4 only. Also verified that if a route-map or label-index
is specified in the "no" case it matches what had been previously
defined. Manual testing looks good and bgp-smoke will be performed
before pushing.
Ticket: CM-16860 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: CCR-7056
ETH_ALEN is not equivalent to ETHER_HDR_LEN. ETHER_HDR_LEN is the
definition for the length of the full ethernet header, meanwhile
ETH_ALEN is just the length of the ethernet address.
Here is the OpenBSD/FreeBSD definition for ETHER_HDR_LEN:
#define ETHER_ADDR_LEN 6 /* Ethernet address length */
#define ETHER_TYPE_LEN 2 /* Ethernet type field length */
#define ETHER_HDR_LEN ((ETHER_ADDR_LEN * 2) + ETHER_TYPE_LEN)
(OpenBSD's definition is at net/if_ether.h, FreeBSD's is at
net/ethernet.h)
Linux definitions can be found at: net/ethernet.h
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
#define ETHER_TYPE_LEN 2 /* bytes in type field */
#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
net/if_ether.h:
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ALEN 6 /* Octets in one ethernet addr */
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Donald Sharp [Wed, 13 Dec 2017 15:58:55 +0000 (10:58 -0500)]
ospf6d: Don't assign to values that are never read
offset and offsetlen are never used without reassigning
in the code. So comment out the assignments and
in case we want to start using the code for snmp
changes in the future.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 8 Dec 2017 20:02:46 +0000 (15:02 -0500)]
zebra: Display if a taged route is being used as a realm
When displaying a specific route and if it has a tag
and if we have turned on realm support notify the user
that a tag value of (1-255) is installed into the kernel
with the realm set.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra: Add ability to support tags -> realms in linux
Linux has the ability to support a concept of 'realms'.
This concept allows you to mark routes with a realm id
value of 1-255. If you have marked the realm
of a route then you can use the tc program to
apply policy to the routes.
This commit adds the ability of FRR to interpret
a tag from (1-255) as a realm when installing into
the kernel. Please note that at this point in time
there is no way to set policy from within FRR. This
must be done outside of it.
The normal methodology for setting tags is valid here
via a route-map.
Finally this is only applied if the --enable-realms configure
option is applied.
Rafael Zalamena [Mon, 11 Dec 2017 20:25:06 +0000 (18:25 -0200)]
isisd: fix l2 neighbor formations
Add a timestamp information for level 2 circuits, otherwise if the
circuit is marked as already processed on level 1 we will not process
level 2 areas.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Donald Sharp [Thu, 7 Dec 2017 15:47:30 +0000 (10:47 -0500)]
zebra: Try to move non zapi cli commands from zserv.c
zserv.c has become a bit of a dumping ground for zebra cli.
I'd like to focus the zserv.c code into it's core functionality
which is handling the zapi interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Rafael Zalamena [Tue, 12 Dec 2017 13:47:04 +0000 (11:47 -0200)]
isisd: save a clock_gettime() call
Use the thread cached clock to use as start time. It will save a call to
clock_gettime() and also provide a more 'accurate' time measurement from
the start of the procedure.
Donald Sharp [Tue, 5 Dec 2017 15:09:36 +0000 (10:09 -0500)]
bgpd: Cleanup SA error in ignoring return from function
Ignoring the return from argv_find_and_parse_afi
makes the SA system assume that you could pass a AFI_MAX
value to bgp_show_route. Which in turn would cause
an array out of bounds read.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>