Commit Graph

2054 Commits

Author SHA1 Message Date
Renato Westphal
aa74131957
Merge pull request #2510 from donaldsharp/extended_ack
zebra: Add extended Ack error parsing to FRR
2018-06-21 12:16:53 -03:00
Donald Sharp
5d307d5d3a zebra: Add extended Ack error parsing to FRR
Add code to request and read in extended ack information
to provide a bit more context of what went wrong when
a failure is detected in the kernel.

Example of a failed delete:
Jun 20 21:19:25 robot zebra[11878]: Extended Error: Invalid prefix for given prefix length
Jun 20 21:19:25 robot zebra[11878]: netlink-cmd (NS 0) error: Invalid argument, type=RTM_DELROUTE(25), seq=8, pid=4078403400
Jun 20 21:19:25 robot zebra[11878]: 0:4.3.2.0/24: Route Deletion failure

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-21 08:07:30 -04:00
paco
7f61ea7bd4
zebra: untrusted array index (Coverity 1470113)
This is a correction over 32ac96b2ba, so
removing the forced string null termination doesn't involve a worse situation
than before (the underflow check should protect for the case of receiving
an incomplete buffer, which would be the cause of non-zero terminated string)

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20 19:25:06 +02:00
Russ White
0c748602f2
Merge pull request #2462 from pacovn/Coverity_1465494_String_not_null_terminated
zebra: string null termination (Coverity 1465494)
2018-06-20 07:55:08 -04:00
Russ White
96be948bcd
Merge pull request #2495 from pacovn/fixme_all_digit
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
2018-06-20 07:38:19 -04:00
Russ White
edc5b3e52e
Merge pull request #2496 from pacovn/fixme_group1
isisd, zebra: FIXME fixes (grouped)
2018-06-20 07:37:27 -04:00
Donald Sharp
46a69f10c0 bgpd, lib, zebra: Remove unnecessary return
The route_map_walk_update_list callback function
never uses the return code, so just remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-19 21:22:46 -04:00
Donald Sharp
75a2b29dd6 zebra: Add initial framework to keep track of changed route-maps
Add some basic code for zebra to start to keep track
of route-maps that have changed.  At this point we
are not doing anything.  As we fix code to handle
route-maps better, code will be shifted around.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-19 21:22:46 -04:00
paco
36228974c2
isisd, zebra: FIXME fixes
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 19:22:13 +02:00
paco
5d5ba0185d
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
This solves a pending FIXME

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 17:59:53 +02:00
paco
32ac96b2ba
zebra: string null termination (Coverity 1465494)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 14:53:31 +02:00
Russ White
fc89ac9846
Merge pull request #2470 from chiragshah6/mdev
zebra: Hide default vrf instance of l3vni cmd
2018-06-19 07:29:13 -04:00
Don Slice
65a6617b64 zebra: re-install static routes needed vrf when the vrf intf comes up
Problem reported that if the vrf device is taken down and then brought
back up, any static route referencing that vrf device was not
re-installed.  This fix runs back thru the static routes that
reference the vrf device coming up and re-install them.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-06-18 11:38:45 +00:00
Chirag Shah
62710e2b33 zebra: Hide default vrf instance of l3vni cmd
Hide following l3vni config from DEFAULT_VRF instance
until it is fully supported.

TORS1(config)# vni 2222456 prefix-routes-only

Ticket:CM-20572

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 15:42:20 -07:00
Donald Sharp
03f290185b zebra: Cleanup code to test for failure once
Cleanup the zebra code to test for failure for reading
from stream once instead of once to see if we should
debug and once for the actual failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-13 09:19:37 -04:00
Donald Sharp
f47598b0f0 zebra: Fix compilation of bsd
Actually return a value.

Fixes: #2413
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-12 15:50:39 -04:00
Rafael Zalamena
b4ba87ebb3
Merge pull request #2406 from pacovn/Coverity_1465495_Out-of-bounds_read
zebra: Out-of-bounds read (Coverity 1465495)
2018-06-12 11:45:11 -03:00
paco
aa360de7a3
zebra: Out-of-bounds read (Coverity 1465495)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-12 15:27:44 +02:00
Donald Sharp
a22addd5a3
Merge pull request #2388 from pacovn/Coverity_1453454_Resource_leak
zebra: resource leak fix (Coverity 1453454)
2018-06-08 14:20:28 -04:00
paco
ee496c3b87
zebra: resource leak fix (Coverity 1453454)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-08 19:18:49 +02:00
paco
77e03f0511 zebra: resource leak fix (Coverity 1465679)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-08 18:51:43 +02:00
Russ White
c96dfcb980
Merge pull request #2385 from donaldsharp/SA_SA_SA
Some small clang 6.0 cleanups
2018-06-08 06:57:30 -04:00
Russ White
71343b85d6
Merge pull request #2292 from donaldsharp/fixup_sb_stuff
Fixup sb stuff
2018-06-08 06:52:01 -04:00
Russ White
49eeb60a70
Merge pull request #2123 from qlyoung/zserv-mt
Multithreaded Zserv
2018-06-08 06:47:14 -04:00
Donald Sharp
b1599bb6f4 vtysh, zebra: Fix function parameters
New version of clang are detecting function parameters that we should
not be casting as such.  Fix these issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-07 19:49:17 -04:00
Renato Westphal
452c9b503b zebra: remove unnecessary preprocessor check
The IFLA_INFO_SLAVE_KIND constant is always defined now that we imported
our own copies of the Linux kernel headers. Remove the preprocessor
checks since they aren't necessary anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-06-07 15:45:33 -03:00
Donald Sharp
10ac25160c zebra: Fix memory leak on host prefix removal
When we have a host prefix, actually free the alloced memory
associated with it when we free it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-04 13:31:34 -04:00
Donald Sharp
7acf817f46
Merge pull request #1976 from pguibert6WIND/issue_1968
Issue 1968 / ip route <> table X
2018-06-04 09:36:01 -04:00
Donald Sharp
dc8daeadaa
Merge pull request #2355 from opensourcerouting/fix-build-freebsd-snmp
build: append -std=gnu99 after SNMP_CFLAGS
2018-06-04 08:36:02 -04:00
Donald Sharp
38bbad1bef zebra: Add some vrf information to debug messages
When debugging code in redistribute.c, it is useful to output
the vrf we think the interface is in.  So display it
when we are debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-04 13:17:38 +02:00
Renato Westphal
7aad159464 build: append -std=gnu99 after SNMP_CFLAGS
Programs that link to libnetsnmp must be compiled using a special set
of flags as specified by the "net-snmp-config --base-cflags" command
(whose output is stored in the SNMP_CFLAGS variable). The problem is
that "net-snmp-config --base-cflags" can output -std=c99 in addition to
other compiler flags in some platforms, and this breaks the build since
FRR souce code makes use of some GNU compiler extensions (e.g. allow
trailing commas in function parameter lists). In order to solve this
problem, append -std=gnu99 after SNMP_CFLAGS in all makefiles where this
variable is used. This way the -std=c99 flag will be overwritten when it's
present. Source files that don't link to libnetsnmp will be compiled using
either -std=gnu99 or -std=gnu11 depending on the compiler availability.

Fixes #1617.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-06-02 22:12:57 -03:00
Philippe Guibert
00384b5fbd zebra: keep one command to handle vty with/without table param
That fix is a workaround from a vtysh limitation.
Because table identifier should be accessible in configuration only for
vrf netns backends, there was a need to differentiate the vty commands.
Unfortunately, vtysh parses the two commands without knowing which
command has really been installed.
Using one single vty command will avoid having this issue in vtysh.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b73823efa1 zebra: add in show vrf information about vrf backend kind
By default, nothing is displayed. If vrf backend is linux network
namespaces, then "netns-based vrfs" is displayed, before dumping the
list of VRFs.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
87d6ac7a04 zebra: add show ip route table vrf command
It is possible to get table per VRF, provided that vrf backend is
configured with NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b3441a6a22 zebra: ns_table list is extended to support multiple NETNS
In the case where vrf backend is netns, then the list of ns tables may
be extended. A single list is kept,but an attribute is added: the ns_id.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
e9748a8901 zebra: table_id election with the vrf backend
As table_id for VRF with netns backend is main table ( RT_TABLE_MAIN or
zebrad.rtm_table_default), this makes possible to return the table id
that wants to be configured for those cases. ( in addition to default
VRF). In other cases ( VRF Lite presumably), then vrf table_id is
returned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b3b086026b zebra: add table keyword to route configuration vty command
Add the table keyword for all ip route/ip mroute/ipv6 route commands
that are available. Also, the main structure is being added a table
identifier.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Donald Sharp
7c5d0e1853 zebra: Add enum dp_req_result to lsp install/deletes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30 08:05:29 -04:00
Donald Sharp
ebecd64913 zebra: Add knowledge of request success/failure for pbr rules
Add some nascent code to handle success/failure of the rule
installation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30 08:05:28 -04:00
Donald Sharp
1e88567226 zebra: Add a result from dataplane request
Add a bit of code to allow return of data plane
request messages.

Add the ability to pass the result back to callers
of kernel_route_rib.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30 08:03:13 -04:00
Donald Sharp
215181cbf1 zebra: Rename SOUTHBOUND_XXX to DP_XXX
The SOUTHBOUND_XXX enum was named a bit poorly.
Let's use a bit better name for what we are trying to do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30 08:00:55 -04:00
Quentin Young
c2ca5ee66d zebra: fix race condition in i/o pthread shutdown
I mistakenly used an external mechanism to cause a pthread to shut
itself down instead of using the one built into frr_pthread.[ch]. This
created a race condition whereby a pthread could schedule work onto a
dead pthread and cause it to reanimate.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:46 +00:00
Quentin Young
c0ea1ae701 zebra: rebase zserv-mt
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:43 +00:00
Quentin Young
ccd51bd210 zebra: misc fixes, perf improvements
* Coalesce multiple write() syscalls into one
* Write larger chunks
* Decrease default read limit to 1000
* Remove unnecessary operations from hot loop (zserv_write)
* Move cross-schedule out of obuf lock
* Use atomic ops to update atomic variable

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
ae6670d013 zebra: don't send data after closing connection
Cancelling threads is nice but they can potentially be scheduled again
after cancellation without an explicit check.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
43ea2c7609 zebra: fix zserv_read rescheduling
Incorrect decrement operation resulted in always rescheduling instead of
only when needed.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
29bed51b74 zebra: fix write task collision
Only one I/O task can be scheduled per file descriptor. Having two
separate tasks for buffer filling and buffer flushing was breaking that
invariant and causing messages to never be written.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
1f312c843d zebra: style
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
822167e704 zebra: some more i/o optimizations
* Separate flush task from write task, so we can continue adding to the
  write buffer while it's waiting to flush
* Handle write errors sooner rather than later
* Only schedule a process job if we have packets to process
* Tweak zserv_process_messages to not reschedule itself and rely on
  zserv_read() to do so in all proper cases

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Quentin Young
e1de21d760 zebra: fix uninitialized value
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00