]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #3103 from dslicenc/bgp-evpn-aggregate
David Lamparter [Mon, 1 Oct 2018 10:44:09 +0000 (12:44 +0200)]
Merge pull request #3103 from dslicenc/bgp-evpn-aggregate

bgpd: enable aggregation in evpn

6 years agoMerge pull request #3107 from opensourcerouting/fix/tools-gitignore
Lou Berger [Mon, 1 Oct 2018 10:43:58 +0000 (06:43 -0400)]
Merge pull request #3107 from opensourcerouting/fix/tools-gitignore

tools: Update .gitignore

6 years agoMerge pull request #3104 from dslicenc/bgp-repeat-aggregate
David Lamparter [Mon, 1 Oct 2018 10:43:15 +0000 (12:43 +0200)]
Merge pull request #3104 from dslicenc/bgp-repeat-aggregate

bgpd: solve issue entering aggregate twice

6 years agoMerge pull request #3074 from jpmondet/master
Martin Winter [Mon, 1 Oct 2018 10:40:11 +0000 (12:40 +0200)]
Merge pull request #3074 from jpmondet/master

frr-reload.py: Python3 compatibility

6 years agoMerge pull request #3034 from donaldsharp/LUA
David Lamparter [Mon, 1 Oct 2018 10:39:51 +0000 (12:39 +0200)]
Merge pull request #3034 from donaldsharp/LUA

Add initial thoughts on having lua act as a replacement for route-maps

6 years agotools: Update .gitignore
Christian Franke [Fri, 28 Sep 2018 18:33:29 +0000 (20:33 +0200)]
tools: Update .gitignore

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agobgpd: resolve change required in pull review for evpn aggregates
Don Slice [Fri, 28 Sep 2018 17:29:18 +0000 (17:29 +0000)]
bgpd: resolve change required in pull review for evpn aggregates

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: solve issue entering aggregate twice
Don Slice [Fri, 28 Sep 2018 15:55:39 +0000 (15:55 +0000)]
bgpd: solve issue entering aggregate twice

Problem reported that frr-relaod.py was not installing an aggregate
properly.  Problem was actually that frr-reload.py does the command
twice, and the second time the aggregate command was entered, it would
appear in the config but the aggregate was removed from the bgp table
and not advertised to peers.  Solved by noticing when an aggregate
was marked for deletion (info_invalid) and allowing the re-entry if
the old one was being removed.

Ticket: CM-22509
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: enable aggregation in evpn
Don Slice [Thu, 27 Sep 2018 16:51:59 +0000 (16:51 +0000)]
bgpd: enable aggregation in evpn

Problem encountered where using the aggregate-address command in an
evpn environment did not work properly.  Depending on the order of
actions, the aggregate may not be created or removed when either the
commands were issued or routes come and go.

Ticket: CM-20585
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #3091 from donaldsharp/routemap_countemup
David Lamparter [Thu, 27 Sep 2018 10:04:24 +0000 (12:04 +0200)]
Merge pull request #3091 from donaldsharp/routemap_countemup

lib: Allow some usage statistics for route-maps

6 years agoMerge pull request #3096 from opensourcerouting/tools-frr-autoconf
Donald Sharp [Thu, 27 Sep 2018 01:46:15 +0000 (21:46 -0400)]
Merge pull request #3096 from opensourcerouting/tools-frr-autoconf

tools/frr: use path settings from ./configure

6 years agobgpd: Add lua match command
Donald Sharp [Tue, 7 Nov 2017 14:14:32 +0000 (09:14 -0500)]
bgpd: Add lua match command

Please note this is a Proof of Concept and not actually something
that is ready to commit at this point.  The file tools/lua.scr
contains some documentation on how we expect it to work currently.
Additionally not all bgp values have been hooked up into the
ability to lua script yet.

There is still significant work to be done here:

1) Add the ability to pass in more data and to adjust the return values
as appropriate.

To set it up:

1) copy tools/lua.scr into /etc/frr (or whereever the config
directory is )

2) Create a route-map match command:
!
router bgp 55
 neighbor 10.50.11.116 remote-as external
 !
 address-family ipv4 unicast
  neighbor 10.50.11.116 route-map TEST in
 exit-address-family
!
route-map TEST permit 10
 match command mooey
!

3) In the lua.scr file make sure that you have a function
named 'mooey' ( as the above example does ):

function mooey ()
   zlog_debug(string.format("Family: %d: %s %d ifindex: %d aspath: %s localpref: %d",
                            prefix.family, prefix.route,
    nexthop.metric, nexthop.ifindex, nexthop.aspath, nexthop.localpref))

   nexthop.metric =  33
   nexthop.localpref = 13
   return 3
end

This example script modifies the metric and localpref currently.  I've also provided
a zlog_debug function in lua to allow some simple debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolua: Initial Lua import
Donald Sharp [Wed, 25 Oct 2017 19:06:30 +0000 (15:06 -0400)]
lua: Initial Lua import

This code sets up the ability to use lua inside of FRR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools/frr: use path settings from ./configure
David Lamparter [Wed, 26 Sep 2018 23:49:07 +0000 (01:49 +0200)]
tools/frr: use path settings from ./configure

...so we properly locate config files and daemons whereever the user
decided to put them.

Signed-Off-By: David Lamparter <equinox@diac24.net>
6 years agofrr-reload.py: Add python2 & python3 compatibility.
jpmondet [Sun, 23 Sep 2018 12:22:17 +0000 (14:22 +0200)]
frr-reload.py: Add python2 & python3 compatibility.

Signed-off-by: jpmondet <jp@mondet.org>
6 years agoMerge pull request #3094 from pacovn/Coverity_1472227_dead_code
Rafael Zalamena [Wed, 26 Sep 2018 17:24:37 +0000 (14:24 -0300)]
Merge pull request #3094 from pacovn/Coverity_1472227_dead_code

ospfd: dead code (Coverity 1472227)

6 years agoMerge pull request #3089 from pacovn/Coverity_1473286_Out_of_bounds_access
Rafael Zalamena [Wed, 26 Sep 2018 17:22:27 +0000 (14:22 -0300)]
Merge pull request #3089 from pacovn/Coverity_1473286_Out_of_bounds_access

isisd: out of bounds access (Coverity 1473286)

6 years agoMerge pull request #3095 from pacovn/Coverity_1473199_1472624_dead_code
Rafael Zalamena [Wed, 26 Sep 2018 16:55:52 +0000 (13:55 -0300)]
Merge pull request #3095 from pacovn/Coverity_1473199_1472624_dead_code

bfdd zebra: dead code (Coverity 1472624 1473199)

6 years agobfdd zebra: dead code (Coverity 1472624 1473199)
F. Aragon [Wed, 26 Sep 2018 15:50:33 +0000 (17:50 +0200)]
bfdd zebra: dead code (Coverity 1472624 1473199)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: dead code (Coverity 1472227)
F. Aragon [Wed, 26 Sep 2018 15:25:42 +0000 (17:25 +0200)]
ospfd: dead code (Coverity 1472227)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #3092 from donaldsharp/bgp_listen_or_listen
Lou Berger [Wed, 26 Sep 2018 14:42:32 +0000 (10:42 -0400)]
Merge pull request #3092 from donaldsharp/bgp_listen_or_listen

bgpd: Don't necessarily ignore interface callbacks

6 years agoMerge pull request #3088 from pacovn/Coverity_1473593_dead_code
Donald Sharp [Wed, 26 Sep 2018 14:36:57 +0000 (10:36 -0400)]
Merge pull request #3088 from pacovn/Coverity_1473593_dead_code

zebra: dead code (Coverity 1473593)

6 years agobgpd: Don't necessarily ignore interface callbacks
Donald Sharp [Tue, 25 Sep 2018 19:25:51 +0000 (15:25 -0400)]
bgpd: Don't necessarily ignore interface callbacks

In bgp if we have not configured bgp we were ignoring
interface based callbacks.  Leading to states where
we may not be processing interface information.
Leading to states where we do not actually keep
ifp data.  As an example:

Suppose vrf A and vrf B.  A has interface swp1.
At the same time we only have a `router bgp 9 vrf B`
When we received the callback for moving swp1
from vrf A to vrf B we were not processing the
move at all and BGP would not consider the interface
part of vrf B at all.

This commit makes bgp pay attention to interface
events irrelevant if bgp is using that vrf.  This
is now consistent with how the lib/if* expects
to work and the rest of the daemons in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulsnetworks.com>
6 years agolib: Allow some usage statistics for route-maps
Donald Sharp [Tue, 25 Sep 2018 19:02:51 +0000 (15:02 -0400)]
lib: Allow some usage statistics for route-maps

Keep track of how often route-maps are applied and
how often each clause of a route-map is applied.

This change showed that `show route-map` was outputting
odd data so fix that output and add in the applied
times too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge branch 'pr/3063'
David Lamparter [Tue, 25 Sep 2018 17:12:37 +0000 (19:12 +0200)]
Merge branch 'pr/3063'

... with typo fixed.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agowatchfrr: Modify some stderr messages to zlog_warn
Donald Sharp [Thu, 20 Sep 2018 15:31:14 +0000 (11:31 -0400)]
watchfrr: Modify some stderr messages to zlog_warn

The stderr output is not being displayed as part of watchfrr invocation
in system startup.  Specifically if the user has not properly sent
1 or more daemons to monitor.  If the end-user is using tools/frr
this stderr is dropped( and systemd appears to drop stderr too? )

Modify the two stderr calls in this situation and use the zlog system.
Now I can clearly see an error message that tells me what has gone wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: fixed typo]

6 years agoisisd: out of bounds access (Coverity 1473286)
F. Aragon [Tue, 25 Sep 2018 15:54:09 +0000 (17:54 +0200)]
isisd: out of bounds access (Coverity 1473286)

rawlspid_print(), which uses a fixed-width 8-byte input, has been replaced with
a call to isis_format_id(), allowing giving the input size.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: dead code (Coverity 1473593)
F. Aragon [Tue, 25 Sep 2018 14:49:34 +0000 (16:49 +0200)]
zebra: dead code (Coverity 1473593)

Conditional code in netlink_macfdb_update() introduced in 2232a77c used
the 'dst_present' variable because not all cases were covered. Now it is
not necessary.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #3081 from donaldsharp/table_table_table
Renato Westphal [Tue, 25 Sep 2018 02:32:50 +0000 (23:32 -0300)]
Merge pull request #3081 from donaldsharp/table_table_table

bgpd, lib, zebra: Wrapper get/set of table->info pointer

6 years agoMerge pull request #3083 from opensourcerouting/list-housekeeping
Donald Sharp [Mon, 24 Sep 2018 23:13:33 +0000 (19:13 -0400)]
Merge pull request #3083 from opensourcerouting/list-housekeeping

ospfd: remove unnecessary housekeeping code when using linked lists

6 years agoospfd: remove unnecessary housekeeping code when using linked lists
Renato Westphal [Mon, 24 Sep 2018 20:42:03 +0000 (17:42 -0300)]
ospfd: remove unnecessary housekeeping code when using linked lists

The head and tail pointers of linked lists should never be modified
manually, the linked list API guarantees that these pointers are always
valid and up-to-date.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #3082 from donaldsharp/memory
Rafael Zalamena [Mon, 24 Sep 2018 20:45:20 +0000 (17:45 -0300)]
Merge pull request #3082 from donaldsharp/memory

pimd: Fix several address sanitizer issues

6 years agopimd: Fix several address sanitizer issues
Donald Sharp [Mon, 24 Sep 2018 19:12:36 +0000 (15:12 -0400)]
pimd: Fix several address sanitizer issues

This commit fixes two issues during pim shutdown.

1) The rp_info structure was being freed before the
outgoing notifications that depended on it's information
was sent out as part of shutdown.

2) The pim->upstream_list shutdown involved iterating
over the list via ALL_LIST_ELEMENTS.  This typically
is enough but pim will auto delete child nodes as well
as itself when it goes away and they depend on it.  As such
the node and nnode could possibly already have been freed.
So change the way we look at all the data in the upstream_list

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3052 from donaldsharp/dplane_2
Russ White [Mon, 24 Sep 2018 14:54:16 +0000 (10:54 -0400)]
Merge pull request #3052 from donaldsharp/dplane_2

Dplane 2

6 years agoMerge pull request #3064 from NaveenThanikachalam/3049
Russ White [Mon, 24 Sep 2018 14:50:52 +0000 (10:50 -0400)]
Merge pull request #3064 from NaveenThanikachalam/3049

lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.

6 years agoMerge pull request #3069 from donaldsharp/bgp_nexthop_address
Russ White [Mon, 24 Sep 2018 14:49:28 +0000 (10:49 -0400)]
Merge pull request #3069 from donaldsharp/bgp_nexthop_address

Bgp nexthop address

6 years agoMerge pull request #3072 from donaldsharp/fix_eigrp_crash_on_int_shut
Russ White [Mon, 24 Sep 2018 14:48:23 +0000 (10:48 -0400)]
Merge pull request #3072 from donaldsharp/fix_eigrp_crash_on_int_shut

eigrpd: Fix eigrp crash on shut of a interface

6 years agoMerge pull request #3073 from donaldsharp/pid_cleanup
Russ White [Mon, 24 Sep 2018 14:47:38 +0000 (10:47 -0400)]
Merge pull request #3073 from donaldsharp/pid_cleanup

Pid cleanup

6 years agoMerge pull request #3075 from donaldsharp/pim_includes
Russ White [Mon, 24 Sep 2018 14:47:01 +0000 (10:47 -0400)]
Merge pull request #3075 from donaldsharp/pim_includes

pimd: Why was pim including zebra headers?

6 years agoMerge pull request #3076 from donaldsharp/eigrp_leaks
Russ White [Mon, 24 Sep 2018 14:46:29 +0000 (10:46 -0400)]
Merge pull request #3076 from donaldsharp/eigrp_leaks

eigrpd: Fix memory leaks and remove dead/unused functions

6 years agoMerge pull request #3020 from donaldsharp/global_5549
Russ White [Mon, 24 Sep 2018 13:55:50 +0000 (09:55 -0400)]
Merge pull request #3020 from donaldsharp/global_5549

Allow v6 global addresses to be nexthops for v4 addresses in bgp

6 years agoMerge pull request #2992 from opensourcerouting/large_as_path_fix
Donald Sharp [Mon, 24 Sep 2018 13:37:47 +0000 (09:37 -0400)]
Merge pull request #2992 from opensourcerouting/large_as_path_fix

bgpd: Fix for large AS paths which are split into segments

6 years agoeigrpd: Fix memory leaks and remove dead/unused functions
Donald Sharp [Mon, 24 Sep 2018 00:41:49 +0000 (20:41 -0400)]
eigrpd: Fix memory leaks and remove dead/unused functions

During shutdown we were not properly cleaning up some memory
as reported by valgrind.  Additionally during cleanup operations
I noticed that there were some dead/unused functions remove/reduce.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd, lib, zebra: Wrapper get/set of table->info pointer
Donald Sharp [Thu, 30 Aug 2018 23:11:39 +0000 (19:11 -0400)]
bgpd, lib, zebra: Wrapper get/set of table->info pointer

Wrapper the get/set of the table->info pointer so that
people are not directly accessing this data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Why was pim including zebra headers?
Donald Sharp [Thu, 30 Aug 2018 23:08:11 +0000 (19:08 -0400)]
pimd: Why was pim including zebra headers?

Remove the inclusion of zebra headers from pim.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3071 from donaldsharp/fix_vrf_name
Lou Berger [Sun, 23 Sep 2018 10:35:14 +0000 (06:35 -0400)]
Merge pull request #3071 from donaldsharp/fix_vrf_name

lib: Allow useful display of default vrf name

6 years agoMerge pull request #3022 from donaldsharp/bgp_abstraction
Lou Berger [Sun, 23 Sep 2018 10:31:31 +0000 (06:31 -0400)]
Merge pull request #3022 from donaldsharp/bgp_abstraction

bgp_node abstraction

6 years agobgpd: Abstract bgp_nexthop_cache retrieving/setting from info pointer
Donald Sharp [Wed, 19 Sep 2018 12:20:37 +0000 (08:20 -0400)]
bgpd: Abstract bgp_nexthop_cache retrieving/setting from info pointer

The bgp_nexthop_cache data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3010 from opensourcerouting/no-frr-thread-id
Lou Berger [Sat, 22 Sep 2018 19:02:09 +0000 (15:02 -0400)]
Merge pull request #3010 from opensourcerouting/no-frr-thread-id

lib: frr_pthread minor simplification

6 years agobgpd: Abstract bgp_connected_ref retrieving/setting from info pointer
Donald Sharp [Mon, 30 Jul 2018 14:46:00 +0000 (10:46 -0400)]
bgpd: Abstract bgp_connected_ref retrieving/setting from info pointer

The bgp_connected_ref data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Abstract bgp_static retrieving/setting from info pointer
Donald Sharp [Mon, 30 Jul 2018 14:30:41 +0000 (10:30 -0400)]
bgpd: Abstract bgp_static retrieving/setting from info pointer

The bgp_static data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Abstract distance retrieving/setting from info pointer
Donald Sharp [Mon, 30 Jul 2018 14:29:28 +0000 (10:29 -0400)]
bgpd: Abstract distance retrieving/setting from info pointer

The bgp_distance data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Abstract aggregate retrieving/setting from info pointer
Donald Sharp [Mon, 30 Jul 2018 12:50:47 +0000 (08:50 -0400)]
bgpd: Abstract aggregate retrieving/setting from info pointer

The aggregate data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: When we can't lock the pid file provide a meaningfull message
Donald Sharp [Sat, 22 Sep 2018 18:18:52 +0000 (14:18 -0400)]
lib: When we can't lock the pid file provide a meaningfull message

Give a hint to the end user that the daemon may already be running.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoRevert "lib: Ensure FRR detects running of the second instance of a FRR daemon, doesn...
Donald Sharp [Sat, 22 Sep 2018 18:14:52 +0000 (14:14 -0400)]
Revert "lib: Ensure FRR detects running of the second instance of a FRR daemon, doesnot allow it to run."

This reverts commit 6e23e5e9e16fb16aafb4ef05ceb3514a02147a21.

6 years agoeigrpd: Fix eigrp crash on shut of a interface
Donald Sharp [Sat, 22 Sep 2018 16:43:32 +0000 (12:43 -0400)]
eigrpd: Fix eigrp crash on shut of a interface

The eigrp interface structure was storing a pointer to the
connected interface structure and on shutdown of an interface
this would cause zebra to call eigrp back with a shutdown of
that interface, as part of that operation the connected interface
structure is being deleted, but eigrp was keeping a pointer to
the connected structure.  At the same time we were keeping the address
of the connected structure and this is all we need, so keep a copy
of that data and use that instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Allow useful display of default vrf name
Donald Sharp [Sat, 22 Sep 2018 16:10:02 +0000 (12:10 -0400)]
lib: Allow useful display of default vrf name

When entering a interface name and you fat-finger it
actually display some useful information about the vrf
we are in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3021 from donaldsharp/more_upstream
David Lamparter [Fri, 21 Sep 2018 21:06:26 +0000 (23:06 +0200)]
Merge pull request #3021 from donaldsharp/more_upstream

zebra_vxlan fixes

6 years agoMerge pull request #3068 from qlyoung/doc-ospf-multi-instance
David Lamparter [Fri, 21 Sep 2018 21:03:19 +0000 (23:03 +0200)]
Merge pull request #3068 from qlyoung/doc-ospf-multi-instance

ospfd: add docs on multi-instance ospf

6 years agoMerge pull request #2978 from ton31337/fix/default_originate_after_second_enter
David Lamparter [Fri, 21 Sep 2018 20:57:28 +0000 (22:57 +0200)]
Merge pull request #2978 from ton31337/fix/default_originate_after_second_enter

osfpd: Install default route after second try instantly

6 years agobgpd: Replace refcount with list of ifp names
Donald Sharp [Fri, 21 Sep 2018 20:02:34 +0000 (16:02 -0400)]
bgpd: Replace refcount with list of ifp names

Track the refcount a bit differently as that it is possible
to get into situations where we have multiple calls for the
same ifc.  So let's just keep a list of the ifc's off of
each `struct bgp_addr` and then keep the hash entry based
upon list count or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Make `struct bgp_addr` a private data structure
Donald Sharp [Fri, 21 Sep 2018 19:50:47 +0000 (15:50 -0400)]
bgpd: Make `struct bgp_addr` a private data structure

The `struct bgp_addr` is not needed for anything other than
the address hash.  Isolate this data structure so that it
is not polluting up the name space.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3067 from donaldsharp/pim_fixes
Jafar Al-Gharaibeh [Fri, 21 Sep 2018 18:50:40 +0000 (13:50 -0500)]
Merge pull request #3067 from donaldsharp/pim_fixes

Pim fixes

6 years agoospfd: add docs on multi-instance ospf
Quentin Young [Fri, 21 Sep 2018 18:31:05 +0000 (18:31 +0000)]
ospfd: add docs on multi-instance ospf

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #3016 from pacovn/label_manager_fixes
Donald Sharp [Fri, 21 Sep 2018 18:03:05 +0000 (14:03 -0400)]
Merge pull request #3016 from pacovn/label_manager_fixes

Label manager fixes

6 years agoMerge pull request #3057 from pacovn/Coverity_1472965_1472966_Dereference_before_null...
Donald Sharp [Fri, 21 Sep 2018 17:37:33 +0000 (13:37 -0400)]
Merge pull request #3057 from pacovn/Coverity_1472965_1472966_Dereference_before_null_check

bgpd: null check (Coverity 1472965 1472966)

6 years agopimd: blackhole traffic when we are not DR for Stream received
Donald Sharp [Fri, 21 Sep 2018 15:41:46 +0000 (11:41 -0400)]
pimd: blackhole traffic when we are not DR for Stream received

Suppose we have a bridge with a host and two routers attached
to it.

r1     r2
|      |
--------
    |
  host

host is sending traffic.
r1 and r2 are pim neighbors and r2 is the DR.

Both r1 and r2 will receive data from the stream up the pim
kernel socket.  r1 will notice that it is not the DR and
stop processing in pim.  This code adds a bit more code to blackhole
the route when r1 detects it is not the DR in this scenario.

This is being done because the kernel is both keeping state and
sending data to the pim process to continue processing this.
Additionally if we happen to be running this on a asic, then
blackholing the route in the asic can save a significant amount
of cpu time handling this situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Add a debug to tell why we are not creating upsteam state
Donald Sharp [Fri, 21 Sep 2018 14:28:57 +0000 (10:28 -0400)]
pimd: Add a debug to tell why we are not creating upsteam state

When we decide we are not the right pim process to add upstream state
for the igmp state received, notice this in a debug to make life
easier to debug.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Add some extra information to a show command
Donald Sharp [Fri, 21 Sep 2018 14:17:48 +0000 (10:17 -0400)]
pimd: Add some extra information to a show command

The tracking of who have drpriority on an interface
in pim was not displayed anywhere.  Add to the show
command for future reference.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.
Naveen Thanikachalam [Fri, 21 Sep 2018 04:15:49 +0000 (21:15 -0700)]
lib: Trigger callbacks to re-evaluate route-map clauses when "call" CLI is executed.

When the "call" CLI is executed from with-in a route-map that is already in use,
there is a need to get the route-map clients to re-evalute the clauses defined
by both the parent route-map, as well as the child route-map.
The existing callbacks, add_hook() and delete_hook() can be used by the lib to
inform the clients when the "call" is configured and unconfigured.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
6 years agobgpd: null check (Coverity 1472965 1472966)
F. Aragon [Thu, 20 Sep 2018 14:00:40 +0000 (16:00 +0200)]
bgpd: null check (Coverity 1472965 1472966)

There were checks for null pointer after being dereferenced. Checks have
been removed (we've discussed the no need of adding assert()'s because
of similar code not requiring them).

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #3056 from pacovn/Coverity_1473285_Explicit_null_dereferenced
Quentin Young [Thu, 20 Sep 2018 19:38:33 +0000 (15:38 -0400)]
Merge pull request #3056 from pacovn/Coverity_1473285_Explicit_null_dereferenced

isisd: null check (Coverity 1473285)

6 years agoMerge pull request #3058 from pacovn/Coverity_1399484_Dereference_null_return_value
Donald Sharp [Thu, 20 Sep 2018 17:16:30 +0000 (13:16 -0400)]
Merge pull request #3058 from pacovn/Coverity_1399484_Dereference_null_return_value

tools: null check (Coverity 1399484)

6 years agoMerge pull request #3062 from pacovn/static_analysis__redundant_parentheses
Donald Sharp [Thu, 20 Sep 2018 17:13:55 +0000 (13:13 -0400)]
Merge pull request #3062 from pacovn/static_analysis__redundant_parentheses

lib: redundant parentheses (SA)

6 years agoMerge pull request #3060 from pacovn/Coverity_1399196_Unchecked_return_value
Donald Sharp [Thu, 20 Sep 2018 17:12:06 +0000 (13:12 -0400)]
Merge pull request #3060 from pacovn/Coverity_1399196_Unchecked_return_value

tools: return check (Coverity 1399196)

6 years agoMerge pull request #3061 from pacovn/static_analysis__Wgnu-redeclared-enum
Donald Sharp [Thu, 20 Sep 2018 17:11:16 +0000 (13:11 -0400)]
Merge pull request #3061 from pacovn/static_analysis__Wgnu-redeclared-enum

zebra: redeclaration fix (SA)

6 years agolib: redundant parentheses (SA)
F. Aragon [Thu, 20 Sep 2018 15:36:21 +0000 (17:36 +0200)]
lib: redundant parentheses (SA)

Redundant parentheses surrounding declarator removed.

Can be detected via static analysis with e.g.

./configure CFLAGS=-Wredundant-parens CC=clang

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: redeclaration fix (SA)
F. Aragon [Thu, 20 Sep 2018 15:25:40 +0000 (17:25 +0200)]
zebra: redeclaration fix (SA)

Unnecesary redeclaration of already-defined enum 'dp_results' removed.

Can be detected via static analysis with e.g.

./configure CFLAGS=-Wgnu-redeclared-enum CC=clang

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agotools: return check (Coverity 1399196)
F. Aragon [Thu, 20 Sep 2018 14:42:31 +0000 (16:42 +0200)]
tools: return check (Coverity 1399196)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agotools: null check (Coverity 1399484)
F. Aragon [Thu, 20 Sep 2018 14:23:52 +0000 (16:23 +0200)]
tools: null check (Coverity 1399484)

Fixed using XCALLOC(MTYPE_TMP, ...) instead of calloc(...) because of the
error handling (XCALLOC checks + log + abort through memory_oom())

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoisisd: null check (Coverity 1473285)
F. Aragon [Thu, 20 Sep 2018 13:39:00 +0000 (15:39 +0200)]
isisd: null check (Coverity 1473285)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoosfpd: Install default route after second try instantly
Donatas Abraitis [Wed, 5 Sep 2018 15:01:47 +0000 (18:01 +0300)]
osfpd: Install default route after second try instantly

Signed-off-by: Donatas Abraitis donatas.abraitis@gmail.com
6 years agozebra: fix debug dplane cli
Mark Stapp [Wed, 11 Jul 2018 18:57:32 +0000 (14:57 -0400)]
zebra: fix debug dplane cli

Fix debug dplane cli doc text; mismatch caused a vtysh error.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agozebra: add 'debug dplane' support and cli
Mark Stapp [Fri, 8 Jun 2018 13:35:07 +0000 (09:35 -0400)]
zebra: add 'debug dplane' support and cli

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agozebra: Start abstraction of zebra_dplane_info for context passing
Mark Stapp [Wed, 12 Sep 2018 18:59:57 +0000 (14:59 -0400)]
zebra: Start abstraction of zebra_dplane_info for context passing

Reduce or eliminate use of global zebra_ns structs in
a couple of netlink/kernel code paths, so that those paths
can potentially be made asynch eventually.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Create zebra_dplane.c and .h
Mark Stapp [Wed, 12 Sep 2018 18:42:03 +0000 (14:42 -0400)]
zebra: Create zebra_dplane.c and .h

Add first sketchy 'dplane' files.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools/checkpatch.pl: recognize _Atomic as modifier
David Lamparter [Wed, 19 Sep 2018 20:05:32 +0000 (22:05 +0200)]
tools/checkpatch.pl: recognize _Atomic as modifier

checkpatch is slightly confused by _Atomic, causing some spurious
warnings.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agolib: remove unused frr_pthread_yield()
David Lamparter [Wed, 12 Sep 2018 19:25:49 +0000 (21:25 +0200)]
lib: remove unused frr_pthread_yield()

OS-level yield is generally a bad and possibly dangerous idea.  If the
thread should be suspended, there should always be something to wait on,
or it turns into busy waiting.  And if it's "just giving something else
the chance to run" - that's the kernel's job to determine, and the
kernel will do so while considering priorities, cgroups, and whatnot.
Let it do its job.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agolib: remove frr_pthread->id
David Lamparter [Wed, 12 Sep 2018 19:23:52 +0000 (21:23 +0200)]
lib: remove frr_pthread->id

All I can see is an unneccessary complication.  If there's some purpose
here it needs to be documented...

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agozebra: Use actual memory type for zebra info pointer
Donald Sharp [Wed, 19 Sep 2018 15:35:43 +0000 (11:35 -0400)]
zebra: Use actual memory type for zebra info pointer

Use MTYPE_ZINFO for the `struct zebra_if` data structure
instead of using MTYPE_TMP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Trust the mac address received in some situations
Donald Sharp [Wed, 19 Sep 2018 15:09:18 +0000 (11:09 -0400)]
zebra: Trust the mac address received in some situations

When we receive a v6 RA packet with an optional
ND_OPT_SOURCE_LINKADDR take that data and construct the
v4 to v6 neighbor entry for that interface to allow
v4 w/ v6 nexthops to work with only global v6 addresses
on an interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Abstract mac neigh installation into it's own function
Donald Sharp [Wed, 19 Sep 2018 15:02:42 +0000 (11:02 -0400)]
zebra: Abstract mac neigh installation into it's own function

Abstract the mac neigh installation for 169.254.0.1 into
it's own function that we can pass the mac address into.
This will allow a future commit to use this functionality
when we have the appropriate mac address from reading
optional attributes of a RA packet.

Signed-off-by: Donald Sharp <sharpd@cumuusnetworks.com>
6 years agodoc: Update documentation with the extended-nexthop bgp command
Donald Sharp [Thu, 13 Sep 2018 16:49:35 +0000 (12:49 -0400)]
doc: Update documentation with the extended-nexthop bgp command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Extend RFC 5549 metaphor a bit more
Donald Sharp [Thu, 6 Sep 2018 13:16:30 +0000 (09:16 -0400)]
bgpd: Extend RFC 5549 metaphor a bit more

Currently we only support RFC 5549 in bgp via
using the `neighbor swp1 interface remote-as ...`
command.  This causes the extended capability
data to be traded as part of the open message.
Additionally at that point in time we notify
zebra to turn on the RA code for that interface
so that the zebra trick of turning the v6 nexthop
into a 169.254.0.1 nexthop and adding a neighbor
entry works.

This code change does 2 things:

1) Modify bgp to pass the extended capability
if we are attempting to establish a v4/unicast
session over a v6 peer.  In the past we limited
this to just the LL based peer.

2) Modify the nexthop tracking code to notice
when it receives nexthop data about the global v6
peer to turn on RA code on those interfaces we will
be using.  This will allow the v4 route with a v6
nexthop received in zebra to auto translate this
correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: fix test (using bgp instance 0)
F. Aragon [Thu, 13 Sep 2018 12:48:21 +0000 (14:48 +0200)]
bgpd: fix test (using bgp instance 0)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: filter zebra messages (label manager)
F. Aragon [Tue, 4 Sep 2018 12:37:00 +0000 (14:37 +0200)]
zebra: filter zebra messages (label manager)

This change makes the zebra acting as label manager proxy not to relay non-LM
messages to clients that a zebra acting in non-proxy mode may send to it. Also,
the existing code does not schedule a rcv in case of relay_response_back
returns -1. This patch re-schedules reads on the socket even in case such a
function returns -1 by calling thread_add_read().

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd, doc, ldpd, lib, tests, zebra: LM fixes
paco [Thu, 7 Jun 2018 13:28:12 +0000 (15:28 +0200)]
bgpd, doc, ldpd, lib, tests, zebra: LM fixes

Corrections so that the BGP daemon can work with the label manager properly
through a label-manager proxy. Details:

- Correction so the BGP daemon behind a proxy label manager gets the range
  correctly (-I added to the BGP daemon, to set the daemon instance id)
- For the BGP case, added an asynchronous label manager connect command so
  the labels get recycled in case of a BGP daemon reconnection. With this,
  BGPd and LDPd would behave similarly.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: Cleanup comments to appropriately match style
Donald Sharp [Mon, 17 Sep 2018 16:13:15 +0000 (12:13 -0400)]
zebra: Cleanup comments to appropriately match style

The block comments from a couple commits were not following
proper style.  Fix.

Fix SA warning that had snuck in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: resolve link dependencies post nldump
Anuradha Karuppiah [Wed, 12 Sep 2018 18:33:51 +0000 (11:33 -0700)]
zebra: resolve link dependencies post nldump

Netdevices are not sorted in any fashion by the kernel during the initial
interface nldump. So you can get an upper device (such as an SVI) before
its corresponding lower device (bridge).

To fix this problem we skip resolving link dependencies during handling of
nldump notifications. Resolving instead at the end (when all the devices
are present)

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Ticket: CM-22388, CM-21796
Reviewed By: CCR-7845
Testing Done:
1. verified on a setup with missing linkages
2. automation - evpn-min

6 years agozebra: Fix neighbor update to BGP
vivek [Mon, 10 Sep 2018 17:19:41 +0000 (10:19 -0700)]
zebra: Fix neighbor update to BGP

Ensure that when the is_router condition changes for a locally learnt
neighbor, it is informed to BGP only if it is active i.e., the MAC is
also locally learnt.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
Ticket: CM-22288
Reviewed By: CCR-7832
Testing Done:
1. Failed test
2. vxlan_routing_test.py