]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoMerge pull request #3605 from donaldsharp/bfd_24_minutes
Rafael Zalamena [Mon, 14 Jan 2019 13:20:54 +0000 (11:20 -0200)]
Merge pull request #3605 from donaldsharp/bfd_24_minutes

bfdd: Fix timer print-out function

5 years agoMerge pull request #3567 from donaldsharp/cleanup_route_table_creation
Renato Westphal [Mon, 14 Jan 2019 12:56:07 +0000 (10:56 -0200)]
Merge pull request #3567 from donaldsharp/cleanup_route_table_creation

Route Table Handling and shows

5 years agoMerge pull request #3564 from chiragshah6/evpn_dev1
Renato Westphal [Mon, 14 Jan 2019 12:50:20 +0000 (10:50 -0200)]
Merge pull request #3564 from chiragshah6/evpn_dev1

zebra: use default vrf_id for zvrf reference

5 years agoMerge pull request #3588 from donaldsharp/bgp_label_nonsense
Renato Westphal [Mon, 14 Jan 2019 12:46:42 +0000 (10:46 -0200)]
Merge pull request #3588 from donaldsharp/bgp_label_nonsense

bgpd: Do not send a label to zebra that it doesn't understand

5 years agoMerge pull request #3600 from opensourcerouting/bfd-zebra-if
Donald Sharp [Mon, 14 Jan 2019 00:18:38 +0000 (19:18 -0500)]
Merge pull request #3600 from opensourcerouting/bfd-zebra-if

bfdd: use zebra API to learn about interfaces

5 years agobfdd: Fix timer print-out function
Donald Sharp [Sat, 12 Jan 2019 21:22:32 +0000 (16:22 -0500)]
bfdd: Fix timer print-out function

The timer2str function thought 24 minutes was an hour and had a
couple of other issues that needed to be corrected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3563 from donaldsharp/minimize_the_stuff
Mark Stapp [Fri, 11 Jan 2019 21:34:20 +0000 (16:34 -0500)]
Merge pull request #3563 from donaldsharp/minimize_the_stuff

Zebra - Some Cleanup

5 years agoMerge pull request #3601 from mjstapp/fix_prov_uninit
Donald Sharp [Fri, 11 Jan 2019 20:55:26 +0000 (15:55 -0500)]
Merge pull request #3601 from mjstapp/fix_prov_uninit

zebra: Fix uninitialized value warning in dplane code

5 years agozebra: Fix uninitialized value warning in dplane code
Mark Stapp [Fri, 11 Jan 2019 18:38:41 +0000 (13:38 -0500)]
zebra: Fix uninitialized value warning in dplane code

Fix a gcc-8 warning (at least) about a possible uninitialized
value in the zebra_dplane code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: Add a switch statement for rib_process_after
Donald Sharp [Thu, 3 Jan 2019 18:50:23 +0000 (13:50 -0500)]
zebra: Add a switch statement for rib_process_after

Future commits are going to introduce more rigor in
state setting in the case of received results from
the data plane.  So let us move the DPLANE_OP_ROUTE_DELETE
state check to the same spot as the rest of the code that
is handling a particular operation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Modify the status flag to 32 bits, add more flags
Donald Sharp [Thu, 3 Jan 2019 18:35:58 +0000 (13:35 -0500)]
zebra: Modify the status flag to 32 bits, add more flags

Modify the status flag from 8 bits to 32 bits and to add
a few new flags that will be used in future commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Limit meta_queue insertion to one time.
Donald Sharp [Thu, 3 Jan 2019 16:56:35 +0000 (11:56 -0500)]
zebra: Limit meta_queue insertion to one time.

Modify the meta_queue insertion such that we only enqueue
the route_node into one meta_queue instead of several.

Suppose we have multiple route_entries associated with
a particular node from rip, bgp, staticd.  If we receive a
route update from rip, we would enqueue the route_node into
the 1, 2, 3 meta-nodes.  Which means that we would run
the entire process of figuring out a route 3 times, while
nothing would change the second two times.

Modify the code to choose the lowest meta-queue and
install it into that one for processing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3599 from donaldsharp/vtysh_sharp
Mark Stapp [Fri, 11 Jan 2019 15:27:36 +0000 (10:27 -0500)]
Merge pull request #3599 from donaldsharp/vtysh_sharp

sharpd: Clean up vtysh warning about insufficient doc string

5 years agoMerge pull request #3597 from mjstapp/dplane_return_prov
Donald Sharp [Fri, 11 Jan 2019 15:24:25 +0000 (10:24 -0500)]
Merge pull request #3597 from mjstapp/dplane_return_prov

zebra: return dataplane provider plugin handle

5 years agosharpd: Clean up vtysh warning about insufficient doc string
Donald Sharp [Fri, 11 Jan 2019 13:58:36 +0000 (08:58 -0500)]
sharpd: Clean up vtysh warning about insufficient doc string

Not sure why this wasn't caught by our CI system.  I thought it
would.  My screw up this should have been right from the start.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
5 years agozebra: return dataplane provider plugin handle
Mark Stapp [Thu, 10 Jan 2019 18:50:33 +0000 (13:50 -0500)]
zebra: return dataplane provider plugin handle

When a dataplane provider/plugin registers, return the new
handle/object - that's needed to use some provider apis
later on.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3591 from donaldsharp/sharp_v6
Mark Stapp [Fri, 11 Jan 2019 12:54:18 +0000 (07:54 -0500)]
Merge pull request #3591 from donaldsharp/sharp_v6

Sharp v6 and stuff

5 years agosharpd: Do addition/subtraction for me
Donald Sharp [Thu, 10 Jan 2019 00:27:10 +0000 (19:27 -0500)]
sharpd: Do addition/subtraction for me

Write a bit of code to track the start/stop times and do subtraction!
In the future we expect this code to slice and dice as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Allow route install/removal of v6 routes.
Donald Sharp [Wed, 9 Jan 2019 23:58:36 +0000 (18:58 -0500)]
sharpd: Allow route install/removal of v6 routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add another 32 bit accessor to the prefix data structure
Donald Sharp [Wed, 9 Jan 2019 23:28:10 +0000 (18:28 -0500)]
lib: Add another 32 bit accessor to the prefix data structure

It would be nice to have the ability to access the prefix data structure
address as a block of 4 uint32_t's.  This will allow me to easily/quickly
update the v6 address by 1.  This will be used in subsuquent commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3511 from pguibert6WIND/handle_multiple_netns_delete_event
Donald Sharp [Fri, 11 Jan 2019 00:21:34 +0000 (19:21 -0500)]
Merge pull request #3511 from pguibert6WIND/handle_multiple_netns_delete_event

zebra: handle multiple events for netns deletion event

5 years agoMerge pull request #3526 from mjstapp/dplane_lists
Donald Sharp [Fri, 11 Jan 2019 00:20:35 +0000 (19:20 -0500)]
Merge pull request #3526 from mjstapp/dplane_lists

zebra: pass lists of results from dataplane to zebra

5 years agobfdd: remove unused OS specific functions
Rafael Zalamena [Thu, 10 Jan 2019 19:20:09 +0000 (17:20 -0200)]
bfdd: remove unused OS specific functions

We are using zebra to learn about the network interfaces and no longer
need to use OS specific system calls to get it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: use zebra to learn about network interfaces
Rafael Zalamena [Thu, 10 Jan 2019 19:13:32 +0000 (17:13 -0200)]
bfdd: use zebra to learn about network interfaces

Don't use system calls to search for and get interface information,
instead use the FRR provided API to learn and cache it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: pass lists of results from dataplane to zebra
Mark Stapp [Fri, 21 Dec 2018 19:12:33 +0000 (14:12 -0500)]
zebra: pass lists of results from dataplane to zebra

Pass lists of results back to zebra from the dataplane subsystem
(and pthread). This helps reduce the lock/unlock cycles when
zebra is busy. Also remove a couple of typedefs that made their
way into the dataplane header file - those violate the FRR style
guidelines.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3589 from donaldsharp/self_vs_thread
Mark Stapp [Thu, 10 Jan 2019 13:49:01 +0000 (08:49 -0500)]
Merge pull request #3589 from donaldsharp/self_vs_thread

lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

5 years agoMerge pull request #3590 from donaldsharp/zebra_pthread_setnames
Mark Stapp [Thu, 10 Jan 2019 13:36:11 +0000 (08:36 -0500)]
Merge pull request #3590 from donaldsharp/zebra_pthread_setnames

FRR pthread setnames

5 years agoMerge pull request #3198 from donaldsharp/mac_rejection
Renato Westphal [Thu, 10 Jan 2019 13:21:18 +0000 (11:21 -0200)]
Merge pull request #3198 from donaldsharp/mac_rejection

Mac rejection

5 years agoMerge pull request #3415 from pguibert6WIND/flowspec_support_nh_tracking
Donald Sharp [Wed, 9 Jan 2019 20:41:16 +0000 (15:41 -0500)]
Merge pull request #3415 from pguibert6WIND/flowspec_support_nh_tracking

Flowspec support nh tracking

5 years agoMerge pull request #3525 from pguibert6WIND/priorise_default_vrf_configured
Donald Sharp [Wed, 9 Jan 2019 20:30:50 +0000 (15:30 -0500)]
Merge pull request #3525 from pguibert6WIND/priorise_default_vrf_configured

zebra: start the netns notification mechanism after ns initialisation

5 years agolib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread
Donald Sharp [Wed, 9 Jan 2019 19:59:22 +0000 (14:59 -0500)]
lib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread

The current invocation of frr_pthread_set_name was causing it reset the os_name.
There is no need for this, we now always create the pthread appropriately
to have both name and os_name.  So convert this function to a simple
call through of the pthread call now.

Before(any of these changes):
sharpd@robot ~/frr1> ps -L -p 16895
  PID   LWP TTY          TIME CMD
16895 16895 ?        00:01:39 bgpd
16895 16896 ?        00:00:54
16895 16897 ?        00:00:07 bgpd_ka

After:
sharpd@donna ~/frr1> ps -L -p 1752
  PID   LWP TTY          TIME CMD
 1752  1752 ?        00:00:00 bgpd
 1752  1753 ?        00:00:00 bgpd_io
 1752  1754 ?        00:00:00 bgpd_ka

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Cleanup thread name setting to happen at start
Donald Sharp [Wed, 9 Jan 2019 19:32:44 +0000 (14:32 -0500)]
lib: Cleanup thread name setting to happen at start

When we start a thread we always call fpt_run and since
the last commit we know os_name is filled with something,
therefore we can just set the name on startup.

This creates this output now for zebra:

sharpd@donna ~/frr2> ps -L -p 25643
  PID   LWP TTY          TIME CMD
25643 25643 ?        00:00:00 zebra
25643 25644 ?        00:00:00 Zebra dplane
25643 25684 ?        00:00:00 zebra_apic
sharpd@donna ~/frr2>

I removed the abstraction to frr_pthread_set_name because
it was snprintf'ing into the same buffer which was the
real bug here( the first character of os_name became null).
In the next commit I'll remove that api because
it is unneeded and was a horrible hack to get
this to work for the one place it was wanted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: On frr_pthread_new save a os_name
Donald Sharp [Wed, 9 Jan 2019 18:41:46 +0000 (13:41 -0500)]
lib: On frr_pthread_new save a os_name

On call of frr_pthread_new, save the os_name if given,
if not given use the name passed in( shortening to fit
in available space ) and finally if the name was not
passed in use the default value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: do not create vrf if name already set to default vrf at startup
Philippe Guibert [Fri, 28 Dec 2018 13:27:45 +0000 (14:27 +0100)]
zebra: do not create vrf if name already set to default vrf at startup

if the default vrf name is manually set, by passing -o parameter to
zebra, then this should be detected when walking the list of netns
available in the system. If a netns called vrf0 is present, then it
should be ignored.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: start the netns notification mechanism after ns initialisation
Philippe Guibert [Fri, 21 Dec 2018 15:25:20 +0000 (16:25 +0100)]
zebra: start the netns notification mechanism after ns initialisation

when zebra is run, by using vrf netns backend mode, then the parser
detector of netns is run before forcing the default vrf to a possible
value. In that case, there is a possibility that the forced '-o' option
will create a second vrf with same name, whereas this option should be
there to uniquely have a default vrf with a value.
To make things consistent, the forced value will be priorised. Then, the
notifier will attempt to create vrf contexts. The expectation is that
the creation will fail, due to an already present vrf with same name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agolib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can
Donald Sharp [Wed, 9 Jan 2019 17:18:21 +0000 (12:18 -0500)]
lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

When using getrusage, we have multiple choices about what
to call for data gathering about this particular thread of execution.

RUSAGE_SELF -> This means gather all cpu run time for all pthreads associated
with this process.

RUSAGE_THREAD -> This means gather all cpu run time for this particular
pthread.

Clearly with data gathering for slow thread as well as `show thread cpu`
it would be preferable to gather only data about the current running
pthread.  This probably was the original behavior of using RUSAGE_SELF
when we didn't have multiple pthreads.  So it didn't matter so much.

Prior to this change, 10 iterations of 1 million routes install/remove
from zebra would give us this cpu time for the dataplane pthread:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0     280902.149    326541      860   2609982      550   2468910    E  dplane_thread_loop

After this change we are seeing this:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0      58045.560    334944      173    277226      539   2502268    E  dplane_thread_loop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Do not send a label to zebra that it doesn't understand
Donald Sharp [Wed, 9 Jan 2019 13:48:37 +0000 (08:48 -0500)]
bgpd: Do not send a label to zebra that it doesn't understand

When using an `import vrf` mechanism we are marking
the vrf label as BGP_PREVENT_VRF_2_VRF_LEAK, and then sending
this down to zebra.  Since zebra knows nothing about this special
value, convert it to a value that it does know MPLS_LABEL_NONE.

This bug was introduced by: 13b7e7f007833c4e2942f40cbd2c2f93a2767e78

And shows up with this error message in the zebra log:

2019/01/09 08:25:16 ZEBRA: Extended Error: Label >= configured maximum in platform_labels
2019/01/09 08:25:16 ZEBRA: [EC 4043309093] netlink-cmd (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=8, pid=3321825991
2019/01/09 08:25:16 ZEBRA: [EC 4043309103] LSP Install Failure: 4294967294

And zebra kept the label as:
donna.cumulusnetworks.com# show mpls table
 Inbound                            Outbound
   Label     Type          Nexthop     Label
--------  -------  ---------------  --------
      -2      BGP            GREEN
      -2      BGP             BLUE

After this fix, neither the labels are stored in zebra nor do we see
the log error message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3565 from rhonda/patch-1
Donald Sharp [Tue, 8 Jan 2019 21:40:45 +0000 (16:40 -0500)]
Merge pull request #3565 from rhonda/patch-1

debianpkg: use getent instead of egrepping files

5 years agodebianpkg: use getent instead of egrepping files
Rhonda D'Vine [Fri, 4 Jan 2019 10:34:13 +0000 (11:34 +0100)]
debianpkg: use getent instead of egrepping files

User data might not be stored in the files in etc. getent is the
dedicated tool to extract those information, regardless of where the
user data is stored

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoMerge pull request #3569 from donaldsharp/recursive_nexthops
Mark Stapp [Tue, 8 Jan 2019 17:15:10 +0000 (12:15 -0500)]
Merge pull request #3569 from donaldsharp/recursive_nexthops

Small cleanup of zebra_rnh.c code

5 years agoMerge pull request #3552 from donaldsharp/zebra_combined_meta_peanuts
Mark Stapp [Tue, 8 Jan 2019 16:59:45 +0000 (11:59 -0500)]
Merge pull request #3552 from donaldsharp/zebra_combined_meta_peanuts

zebra: Consolidate meta_queue_map into route_info

5 years agoMerge pull request #3531 from marauderlabs/docs-fix
Quentin Young [Tue, 8 Jan 2019 16:04:46 +0000 (11:04 -0500)]
Merge pull request #3531 from marauderlabs/docs-fix

doc: Fix typos and grammar

5 years agoMerge pull request #3566 from pguibert6WIND/fix_vrf_netns_broken
Donald Sharp [Tue, 8 Jan 2019 15:48:16 +0000 (10:48 -0500)]
Merge pull request #3566 from pguibert6WIND/fix_vrf_netns_broken

zebra: fix vrf netns broken

5 years agoMerge pull request #3582 from opensourcerouting/freebsd-route-fix
Donald Sharp [Tue, 8 Jan 2019 15:41:52 +0000 (10:41 -0500)]
Merge pull request #3582 from opensourcerouting/freebsd-route-fix

zebra: fix FreeBSD breakage

5 years agozebra: update local ns_id field
Philippe Guibert [Mon, 7 Jan 2019 08:55:10 +0000 (09:55 +0100)]
zebra: update local ns_id field

ns_id field must be synced with ns_id from netns service.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: fix another FreeBSD warning message
Rafael Zalamena [Tue, 8 Jan 2019 12:37:22 +0000 (10:37 -0200)]
zebra: fix another FreeBSD warning message

When an empty netmask a wrong end size is calculated, lets handle this
corner case to avoid spurious warning messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #3575 from LabNConsulting/working/master/no-bgp-attr-255
Donald Sharp [Tue, 8 Jan 2019 12:35:11 +0000 (07:35 -0500)]
Merge pull request #3575 from LabNConsulting/working/master/no-bgp-attr-255

bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

5 years agozebra: fix FreeBSD warning on fresh OS boot
Rafael Zalamena [Tue, 8 Jan 2019 12:32:28 +0000 (10:32 -0200)]
zebra: fix FreeBSD warning on fresh OS boot

Handle corner case where a warning log message is issued on interface
address netmask handling with sockaddr type AF_LINK: it may come empty
or with match all (all 0xFF).

In the first case all lengths are zero and we only need to copy the
first bytes, second case it comes with a zero index and all 0xFF bytes.

In any case we only need to figure out a few of the first bytes instead
of all data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #3562 from donaldsharp/sharp_multiple_installs
Lou Berger [Tue, 8 Jan 2019 11:55:27 +0000 (06:55 -0500)]
Merge pull request #3562 from donaldsharp/sharp_multiple_installs

Sharp multiple installs

5 years agozebra: implement FreeBSD route attr handling
Rafael Zalamena [Tue, 8 Jan 2019 10:14:28 +0000 (08:14 -0200)]
zebra: implement FreeBSD route attr handling

When porting routing socket macro data handling to functions, the
attribute function was forgotten. The only difference between the
attribute and address handler is the family type check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agodoc: Fix typos and grammar
Anand [Tue, 8 Jan 2019 04:41:14 +0000 (04:41 +0000)]
doc: Fix typos and grammar

Signed-off-by: Anand <anandakumar.u@gmail.com>
5 years agobgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 22:16:37 +0000 (22:16 +0000)]
bgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agobgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 20:00:34 +0000 (20:00 +0000)]
bgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agobgpd: Modify End of Rib notification to INFO
Donald Sharp [Sat, 22 Dec 2018 00:16:52 +0000 (19:16 -0500)]
bgpd: Modify End of Rib notification to INFO

The End of Rib notification in BGP is useful to know no matter
the circumstances.  So change this from a debug message to
an info and cleanup the message a bit and add vrf we are in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Lou Berger [Mon, 7 Jan 2019 16:32:54 +0000 (11:32 -0500)]
bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #3572 from manuhalo/fix_isisd_p2p
Donald Sharp [Mon, 7 Jan 2019 14:26:38 +0000 (09:26 -0500)]
Merge pull request #3572 from manuhalo/fix_isisd_p2p

isisd: fix point-to-point network type config

5 years agoisisd: fix point-to-point network type config
Emanuele Di Pascale [Mon, 7 Jan 2019 11:29:29 +0000 (12:29 +0100)]
isisd: fix point-to-point network type config

`isis network point-to-point` was being rejected from the configuration
file as it was being processed before the reception of the UP zebra
notification for the interface. This meant that the `circ_type` was set
at CIRCUIT_T_UNKNOWN, which led the northbound callback to fail. This
check was removed as it was not really necessary; when the zebra
notification is received, the correct circuit type will be enforced,
but now the point-to-point config will be saved and correctly applied
when zebra recognizes the interface as a broadcast one.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agozebra: dup addr detect fix clear mac command
Chirag Shah [Sat, 15 Dec 2018 02:34:06 +0000 (18:34 -0800)]
zebra: dup addr detect fix clear mac command

For neigh check duplicate flag as it can be inherited from
duplicate detected MAC (count could be 0).

Ticket:CM-23316

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: evpn dup addr detect fix unfreeze action
Chirag Shah [Mon, 17 Dec 2018 22:36:27 +0000 (14:36 -0800)]
zebra: evpn dup addr detect fix unfreeze action

Below are cases where EVPN duplicate detection
Freeze and Unfreeze required fixes:

Auto recovery needs to check neighbor's duplicate flag
to take action, as neigh could be marked duplicate
via inherited from MAC where IP detection count could be 0.

MAC duplicate detection needs to set flag to true
if freeze action is configured.

Local MAC add update should not send update to bgp
if MAC is in frozen state.

Remote MAC-IP update should not process neigh update if MAC
is detected as duplicate during remote update.

Ticket:CM-23344
Testing Done:
Trigger duplicate detection via both local and remote update trigger,
Validate clear command and other changes expected behavior.

Auto-recovery takes appropriate action on inherited IPs.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3529 from donaldsharp/some_integration
Jafar Al-Gharaibeh [Fri, 4 Jan 2019 19:20:22 +0000 (14:20 -0500)]
Merge pull request #3529 from donaldsharp/some_integration

Cleanup of some PIM, very early start of MLAG integration info zebra

5 years agopimd: Allow pim to display what it believes the mlag role is.
Donald Sharp [Fri, 21 Dec 2018 14:55:08 +0000 (09:55 -0500)]
pimd: Allow pim to display what it believes the mlag role is.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Store the router mlag role
Donald Sharp [Fri, 21 Dec 2018 14:30:54 +0000 (09:30 -0500)]
pimd: Store the router mlag role

When we are told about the mlag role, store it for later usage.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Remove pimg
Donald Sharp [Fri, 21 Dec 2018 14:23:36 +0000 (09:23 -0500)]
pimd: Remove pimg

The pimg data structure is only used in one spot to send the default
vrf id to zebra upon startup.  Add the default vrf id to the struct pim_router
data structure and remove the pimg pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Remove pim_msdp_config_write as it was never used
Donald Sharp [Fri, 21 Dec 2018 14:19:26 +0000 (09:19 -0500)]
pimd: Remove pim_msdp_config_write as it was never used

This function was never used, additionally rename the _helper
function to this name.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Move register_probe_time to pim_router
Donald Sharp [Fri, 21 Dec 2018 13:59:38 +0000 (08:59 -0500)]
pimd: Move register_probe_time to pim_router

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Move packet_process variable to pim_router
Donald Sharp [Fri, 21 Dec 2018 13:57:22 +0000 (08:57 -0500)]
pimd: Move packet_process variable to pim_router

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Move register_suppress_time into struct pim router
Donald Sharp [Fri, 21 Dec 2018 13:54:07 +0000 (08:54 -0500)]
pimd: Move register_suppress_time into struct pim router

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Convert rpf_cache_refresh_delay_msec into pim_router struct
Donald Sharp [Fri, 21 Dec 2018 13:50:34 +0000 (08:50 -0500)]
pimd: Convert rpf_cache_refresh_delay_msec into pim_router struct

Move the rpf_cache_refresh_delay_msec into the pim_router since
it should own the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Move the infinite_assert_metric global to pim_router
Donald Sharp [Thu, 20 Dec 2018 16:18:14 +0000 (11:18 -0500)]
pimd: Move the infinite_assert_metric global to pim_router

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Convert qpim_t_periodic into the `struct pim_router` structure
Donald Sharp [Thu, 20 Dec 2018 15:45:33 +0000 (10:45 -0500)]
pimd: Convert qpim_t_periodic into the `struct pim_router` structure

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Move debugs into pim_router structure
Donald Sharp [Thu, 20 Dec 2018 15:39:59 +0000 (10:39 -0500)]
pimd: Move debugs into pim_router structure

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Create a `struct pim_router` and move thread master into it
Donald Sharp [Thu, 20 Dec 2018 15:34:04 +0000 (10:34 -0500)]
pimd: Create a `struct pim_router` and move thread master into it

Create a `struct pim_router` and move the thread master into it.
Future commits will further move global varaibles into the pim_router
structure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add test and show commands for mlag
Donald Sharp [Tue, 18 Dec 2018 13:48:00 +0000 (08:48 -0500)]
zebra: Add test and show commands for mlag

Add a 'test zebra mlag <none|master|slave>` and
a `show zebra mlag` comamnd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add mlag_role2str function
Donald Sharp [Fri, 21 Dec 2018 14:46:48 +0000 (09:46 -0500)]
lib: Add mlag_role2str function

Add a generic mlag_role2str function for lib since multiple daemons
will be using this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add the reading of capabilities on startup.
Donald Sharp [Tue, 18 Dec 2018 13:13:25 +0000 (08:13 -0500)]
pimd: Add the reading of capabilities on startup.

Just add the ability to notice the capabilities on startup,
but don't do anything with it yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: On startup send mlag role as part of the capabilities
Donald Sharp [Tue, 18 Dec 2018 13:09:29 +0000 (08:09 -0500)]
lib, zebra: On startup send mlag role as part of the capabilities

On startup send the mlag role as part of the capabilities to
the end protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add a retrieve the mlag role function
Donald Sharp [Tue, 18 Dec 2018 13:01:50 +0000 (08:01 -0500)]
zebra: Add a retrieve the mlag role function

Add the ability to retrieve the current role of mlag for this machine.

If mlag is not setup we will always return MLAG_ROLE_NONE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add some small infrastructure to get the mlag code in zebra started
Donald Sharp [Tue, 18 Dec 2018 12:44:23 +0000 (07:44 -0500)]
zebra: Add some small infrastructure to get the mlag code in zebra started

Add a zebra_mlag.h and a zebra_mlag.c startup/shutdown code to zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add a basic mlag.h file
Donald Sharp [Tue, 18 Dec 2018 12:35:28 +0000 (07:35 -0500)]
lib: Add a basic mlag.h file

This is the start of a series of commits that will allow FRR to
be integrated into mlag.

Zebra and Pim will both need mlag state for the router.  As such we will
need to provide a abstract about this state through the zapi.

This is the start of the common header that both Pim and Zebra will
be using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove zebra_delete_rnh from being a public function
Donald Sharp [Fri, 4 Jan 2019 16:04:38 +0000 (11:04 -0500)]
zebra: Remove zebra_delete_rnh from being a public function

The zebra_delete_rnh function is not needed to be exposed
to the entire world.  Limit it's scope.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Abstract zebra_delete_rnh
Donald Sharp [Fri, 4 Jan 2019 16:02:35 +0000 (11:02 -0500)]
zebra: Abstract zebra_delete_rnh

The deletion of a rnh is always proceeded by the same checks
to see if it is done.  Just let zebra_delete_rnh do this test.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add a dump table information command to zebra
Donald Sharp [Fri, 4 Jan 2019 14:41:09 +0000 (09:41 -0500)]
zebra: Add a dump table information command to zebra

Allow zebra to dump the table information it has from a router perspective.

This table looks like this:
donna.cumulusnetworks.com# show zebra router table summary
VRF             NS ID    VRF ID     AFI            SAFI    Table      Count
---------------------------------------------------------------------------
default             0         0    IPv4         unicast       49          1
default             0         0    IPv4         unicast      254          7
default             0         0    IPv4       multicast      254          9
default             0         0    IPv6         unicast      254          1
default             0         0    IPv6       multicast      254          1
BLUE                0        31    IPv4         unicast     1005          0
BLUE                0        31    IPv4       multicast     1005          0
BLUE                0        31    IPv6         unicast     1005          0
BLUE                0        31    IPv6       multicast     1005          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agostaticd: Fix nht to include SAFI_MULTICAST
Donald Sharp [Fri, 4 Jan 2019 14:42:11 +0000 (09:42 -0500)]
staticd: Fix nht to include SAFI_MULTICAST

The nexthop tracking was correctly registering the nexthops in
the SAFI_UNICAST table, but we need to apply them to the
SAFI_MULTICAST mroute information( if any ) as well.

donna.cumulusnetworks.com# conf t
donna.cumulusnetworks.com(config)# ip mroute 230.0.4.0/24 192.168.210.50
donna.cumulusnetworks.com(config)# end
donna.cumulusnetworks.com# show ip rpf
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

C>* 10.0.2.0/24 is directly connected, enp0s3, 00:08:28
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:08:28
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:08:28
S>* 230.0.4.0/24 [1/0] via 192.168.210.50, enp0s9, 00:07:56
S>* 230.0.5.0/24 [1/0] via 192.168.210.50, enp0s9, 00:07:17

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Store actual safi in info pointer and don't free then remalloc
Donald Sharp [Fri, 4 Jan 2019 13:36:02 +0000 (08:36 -0500)]
zebra: Store actual safi in info pointer and don't free then remalloc

When we call zebra_vrf_table_create, we've already created the info
pointer in zebra_router_get_table, so properly set the info->safi
and just store the zvrf->table[afi][safi] value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: handle multiple events for netns deletion event
Philippe Guibert [Tue, 18 Dec 2018 17:00:31 +0000 (18:00 +0100)]
zebra: handle multiple events for netns deletion event

When handling events from /var/run/netns folder, if several netns are
removed at the same time, only the first one is deleted in the frr. Fix
this behaviour by applying continue in the loop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: use default vrf_id for zvrf reference
Chirag Shah [Thu, 3 Jan 2019 00:48:32 +0000 (16:48 -0800)]
zebra: use default vrf_id for zvrf reference

Duplicate address detection should operate
at default vrf instance.
For mac and neigh show command, auto recovery and few places
where tanent vrf_id used for zvrf instead use default
vrf instance. Use vxlan_if's or VRF_DEFAULT vrf_id to
fetch zebra's default vrf instance.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3561 from opensourcerouting/northbound-freebsd-fix
Quentin Young [Thu, 3 Jan 2019 16:48:31 +0000 (11:48 -0500)]
Merge pull request #3561 from opensourcerouting/northbound-freebsd-fix

lib: fix segfault on freebsd when using vsnprintf() incorrectly

5 years agodoc: Update documentation to new functionality
Donald Sharp [Thu, 3 Jan 2019 14:57:06 +0000 (09:57 -0500)]
doc: Update documentation to new functionality

Update sharp.rst to reflect new functionality in the `sharp install ..`
command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Add code to allow install/uninstall repeatedly
Donald Sharp [Thu, 3 Jan 2019 14:49:15 +0000 (09:49 -0500)]
sharpd: Add code to allow install/uninstall repeatedly

Add a bit of test code to allow the tester to install/uninstall
the routes via:

sharp install routes A.B.C.D nexthop Y.Z.M.D 1000000 repeat 100

This will install 1000000 routes wait for them to be finished
then uninstall them then start installation over 100 times.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
5 years agoMerge pull request #3558 from opensourcerouting/silence-ioctl-warning
Russ White [Thu, 3 Jan 2019 02:43:18 +0000 (21:43 -0500)]
Merge pull request #3558 from opensourcerouting/silence-ioctl-warning

zebra: silence harmless ioctl warning when retrieving interface speed

5 years agoMerge pull request #3560 from opensourcerouting/fix-sh-bgp-community
Russ White [Thu, 3 Jan 2019 02:42:50 +0000 (21:42 -0500)]
Merge pull request #3560 from opensourcerouting/fix-sh-bgp-community

bgpd: fix parsing of community number in the "show bgp community" command

5 years agoMerge pull request #3549 from chiragshah6/mdev
Russ White [Thu, 3 Jan 2019 02:39:58 +0000 (21:39 -0500)]
Merge pull request #3549 from chiragshah6/mdev

bgpd: evpn command to restrict to default vrf

5 years agolib: fix segfault on freebsd when using vsnprintf() incorrectly
Renato Westphal [Thu, 3 Jan 2019 00:32:13 +0000 (22:32 -0200)]
lib: fix segfault on freebsd when using vsnprintf() incorrectly

FreeBSD's libc segfaults when vsnprintf() is called with a null
format string. Add a null check before calling vsnprintf() to
resolve this problem.

Fixes #3537

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix parsing of community number in the "show bgp community" command
Renato Westphal [Wed, 2 Jan 2019 21:25:02 +0000 (19:25 -0200)]
bgpd: fix parsing of community number in the "show bgp community" command

Fixes #3545.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agosharpd: Abstract the route install/delete functions a bit
Donald Sharp [Wed, 2 Jan 2019 19:38:15 +0000 (14:38 -0500)]
sharpd: Abstract the route install/delete functions a bit

Abstract the route install/delete functions a bit to allow me to
expand on them in the with future commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: silence harmless ioctl warning when retrieving interface speed
Renato Westphal [Wed, 2 Jan 2019 18:47:51 +0000 (16:47 -0200)]
zebra: silence harmless ioctl warning when retrieving interface speed

zebra uses the SIOCETHTOOL ioctl with the ETHTOOL_GSET command to
fetch the speed of interfaces from the kernel. The only problem is
that ETHTOOL_GSET returns EOPNOTSUPP when the given interface is a
virtual interface. This leads to zebra emitting warnings like this
at startup:

ZEBRA: IOCTL failure to read interface lo speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface dummy0 speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface ovs-system speed: 95 Operation not supported

Silence these warnings by ignoring EOPNOTSUPP errors, since we know
they are harmless. This is similar to how we handle EINVAL errors
from the BSD SIOCGIFMEDIA ioctl (commit c69f2c1ff).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg
Quentin Young [Wed, 2 Jan 2019 18:50:47 +0000 (13:50 -0500)]
Merge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg

zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

5 years agoMerge pull request #3550 from donaldsharp/sharp_nhg
Renato Westphal [Wed, 2 Jan 2019 16:42:34 +0000 (14:42 -0200)]
Merge pull request #3550 from donaldsharp/sharp_nhg

Sharp nhg

5 years agoMerge pull request #3534 from opensourcerouting/netlink-length-duplicated
Quentin Young [Wed, 2 Jan 2019 15:53:49 +0000 (10:53 -0500)]
Merge pull request #3534 from opensourcerouting/netlink-length-duplicated

zebra: remove duplicated code

5 years agozebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
Renato Westphal [Wed, 2 Jan 2019 15:05:53 +0000 (13:05 -0200)]
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

Unlike the other interface zapi messages, ZEBRA_INTERFACE_VRF_UPDATE
identifies interfaces using ifindexes and not interface names. This
is a problem because zebra always sends ZEBRA_INTERFACE_DOWN
and ZEBRA_INTERFACE_DELETE messages before sending
ZEBRA_INTERFACE_VRF_UPDATE, and the ZEBRA_INTERFACE_DELETE callback
from all daemons set the interface index to IFINDEX_INTERNAL. Hence,
when decoding a ZEBRA_INTERFACE_VRF_UPDATE message, the interface
lookup would always fail since the corresponding interface lost
its ifindex. Example (ospfd):

OSPF: Zebra: Interface[rt1-eth2] state change to down.
OSPF: Zebra: interface delete rt1-eth2 vrf default[0] index 8 flags 11143 metric 0 mtu 1500
OSPF: [EC 100663301] INTERFACE_VRF_UPDATE: Cannot find IF 8 in VRF 0

To fix this problem, use interface names instead of ifindexes to
indentify interfaces like the other interface zapi messages do.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>