]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoMerge pull request #297 from opensourcerouting/ldpd-openbsd
Donald Sharp [Thu, 30 Mar 2017 11:23:59 +0000 (06:23 -0500)]
Merge pull request #297 from opensourcerouting/ldpd-openbsd

Add support for MPLSv6 in OpenBSD + minor fixes

7 years agoMerge pull request #296 from opensourcerouting/ldpd-sighup
Donald Sharp [Thu, 30 Mar 2017 11:18:25 +0000 (06:18 -0500)]
Merge pull request #296 from opensourcerouting/ldpd-sighup

ldpd: do a full configuration reload upon receiving a SIGHUP

7 years agolib: sandbox: print vtysh daemon targets
David Lamparter [Wed, 22 Mar 2017 09:45:51 +0000 (10:45 +0100)]
lib: sandbox: print vtysh daemon targets

This is very useful to check whether a command disappeared from a
specific daemon (by comparing against an earlier output of
"grammar find-ambiguous printall nodescan")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agovtysh: parsing fixes on distribute-list
David Lamparter [Wed, 22 Mar 2017 09:22:14 +0000 (10:22 +0100)]
vtysh: parsing fixes on distribute-list

The vtysh preprocessing stuff doesn't like the first argument to
install_element() being something other than a _NODE constant, and the
comment hack wasn't cutting it... just expand this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agovtysh: remove ignore list
David Lamparter [Wed, 22 Mar 2017 09:39:06 +0000 (10:39 +0100)]
vtysh: remove ignore list

With DEFUN_NOSH in place everywhere, this is useless.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: apply DEFUN_NOSH for node-switch CLI commands
David Lamparter [Wed, 22 Mar 2017 09:38:22 +0000 (10:38 +0100)]
*: apply DEFUN_NOSH for node-switch CLI commands

These have copies in vtysh that do the node-switch locally and are
listed in extract.pl's ignore list.  The ignore list however is
redundant since DEFUN_NOSH does the same thing...

ldpd is a bit hacky, but Renato is reworking this anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agodoc: minor tweaks in the build instructions
Renato Westphal [Tue, 28 Mar 2017 00:39:27 +0000 (21:39 -0300)]
doc: minor tweaks in the build instructions

* ldpd is built by default in all platforms, it's not necessary to
  provide --enable-ldpd anymore;
* Remove comment about ldpd not being tested on OpenBSD, it works very
  well on this platform;
* Provide instructions to enable MPLS forwarding in OpenBSD.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra-mpls: replace legacy bzero by memset
Renato Westphal [Tue, 28 Mar 2017 00:17:37 +0000 (21:17 -0300)]
zebra-mpls: replace legacy bzero by memset

bzero() was deprecated in POSIX.1-2001 and removed in POSIX.1-2008 in
deference to memset().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra-mpls: add support for MPLSv6 in OpenBSD
Renato Westphal [Tue, 28 Mar 2017 00:13:29 +0000 (21:13 -0300)]
zebra-mpls: add support for MPLSv6 in OpenBSD

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: replace all occurrences of '\n' with VTY_NEWLINE
Renato Westphal [Mon, 27 Mar 2017 23:14:09 +0000 (20:14 -0300)]
ldpd: replace all occurrences of '\n' with VTY_NEWLINE

The format of the terse output of several ldpd's show commands was copied
from the OpenBSD's ldpctl(8) control program. In the process of doing
that I forgot to replace the occurrences of '\n' with VTY_NEWLINE.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: update pledge promise in lde
Renato Westphal [Mon, 27 Mar 2017 18:03:34 +0000 (15:03 -0300)]
ldpd: update pledge promise in lde

With the introduction of the label manager, now lde needs to pledge
"unix" as well in order to connect to zebra.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix pseudowire merge algorithm
Renato Westphal [Sat, 25 Mar 2017 23:57:03 +0000 (20:57 -0300)]
ldpd: fix pseudowire merge algorithm

The previous algorithm wasn't failsafe for full configuration reloads
where several pseudowires can be inserted or removed at the same
time. This patch introduces a much simpler logic that solves the problem
in a better way.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: remove a few unnecessary functions
Renato Westphal [Sat, 25 Mar 2017 23:52:42 +0000 (20:52 -0300)]
ldpd: remove a few unnecessary functions

The original ldpd(8) daemon in OpenBSD doesn't allow the user to put
non-existing interfaces in the configuration file. For this reason,
the l2vpn_if_find() and l2vpn_pw_find() functions take an ifindex as
an argument.  In FRR's ldpd we can put non-existing interfaces in the
configuration, and they are activated as soon as they are available. For
this reason, we can't lookup interfaces by their ifindex in this port.
The l2vpn_if_find_name() and l2vpn_pw_find_name() functions were
introduced to address this issue. However, since the "find-by-ifindex"
functions are not being used anymore, we can just remove them and rename
the *_find_name() functions removing the "_name" suffix.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: do a full configuration reload upon receiving a SIGHUP
Renato Westphal [Wed, 22 Mar 2017 15:53:36 +0000 (12:53 -0300)]
ldpd: do a full configuration reload upon receiving a SIGHUP

The rationale here is to do something very similar to what the original
OpenBSD's ldpd(8) does to reload configuration files:
* create a new empty base configuration (vty_conf);
* parse the configuration file and store the result in vty_conf;
* merge the new configuration into the current configuration.

To do this, introduce a new global variable called "sighup" so that ldpd
doesn't attempt to merge vty_conf into ldpd_conf for each command in
the configuration file, which would be very disruptive. vty_conf should
be merged only after the whole configuration file is parsed in order to
avoid taking actions like shutting down neighbors when not necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: ignore the SIGHUP signal in the child processes
Renato Westphal [Sun, 26 Mar 2017 00:28:13 +0000 (21:28 -0300)]
ldpd: ignore the SIGHUP signal in the child processes

Only the parent process should handle the SIGHUP signal, but we need
to make sure that this signal is ignored in the child processes so a
command like "killall -SIGHUP ldpd" won't kill ldpd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: simplify handling of configuration commands
Renato Westphal [Thu, 23 Mar 2017 17:49:28 +0000 (14:49 -0300)]
ldpd: simplify handling of configuration commands

The logic to make configuration changes in ldpd is as follows:
1 - duplicate the current configuration;
2 - modify the duplicated configuration (delta);
3 - merge the duplicated configuration into the current configuration.

We can however change things a little bit in order to simplify the code.

If we provide a global vty_conf variable and make sure that it's
always an up-to-date duplicate of ldpd_conf, then we don't need to call
ldp_dup_config() in the callback of each configuration command. Instead
of that, we just need to duplicate ldpd_conf in the startup of the daemon
and in the end of the ldp_reload() function. Doing this is safe because,
due to the single-threaded nature of the parent process, it's impossible
to have multiple requests to change the configuration at the same time.

Also, we can remove the *_ref() functions and do something much simpler
instead.  The problem we have to deal with here is that VTY_GET_CONTEXT()
returns a pointer to an element of ldpd_conf, and what we want is a
pointer to an element of vty_conf (e.g. an l2vpn).  To solve this,
we just need to look for the equivalent element inside vty_conf using
standard functions from ldpd like l2vpn_find() and others.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: drop privileges earlier in the parent process
Renato Westphal [Wed, 22 Mar 2017 19:23:46 +0000 (16:23 -0300)]
ldpd: drop privileges earlier in the parent process

This solves a bug where log files created with "log file" were being
created root-owned. So, inserting the "log file" command multiple times
with the same path would fail giving a permission denied error.

Also, rearrange the main() function to call start_child() as soon as
possible to avoid a bunch of unnecessary initializations in the forked
processes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #292 from donaldsharp/sgrpt_prune
David Lamparter [Sat, 25 Mar 2017 09:10:22 +0000 (10:10 +0100)]
Merge pull request #292 from donaldsharp/sgrpt_prune

Sgrpt prune

7 years agoMerge pull request #286 from opensourcerouting/ldpd-tshoot
Donald Sharp [Fri, 24 Mar 2017 11:17:06 +0000 (07:17 -0400)]
Merge pull request #286 from opensourcerouting/ldpd-tshoot

Ldpd tshoot

7 years agopimd: del_oif and pim_channel_del_oif are the same function
Donald Sharp [Thu, 23 Mar 2017 11:47:41 +0000 (07:47 -0400)]
pimd: del_oif and pim_channel_del_oif are the same function

These two functions do the exact same thing.  Refactor

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Update inherited_olist when receiving a prune
Donald Sharp [Wed, 22 Mar 2017 14:11:04 +0000 (10:11 -0400)]
pimd: Update inherited_olist when receiving a prune

We were not always updating the inherited_olist
when we received a prune.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix inherited_olist decision for *,G
Donald Sharp [Wed, 22 Mar 2017 14:09:00 +0000 (10:09 -0400)]
pimd: Fix inherited_olist decision for *,G

When we had a *,G join but a Prune S,G,rpt we
were not taking that into account.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: When deleting last intf from an OIL don't delete the mroute
Donald Sharp [Wed, 22 Mar 2017 14:07:18 +0000 (10:07 -0400)]
pimd: When deleting last intf from an OIL don't delete the mroute

In certain conditions when we are deleting the interface
from an OIL do not delete the mroute.  That decision
should be made by the state machine.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Start sending (S,G,rpt) Prune messages
Donald Sharp [Tue, 7 Mar 2017 02:08:12 +0000 (21:08 -0500)]
pimd: Start sending (S,G,rpt) Prune messages

Start sending the (S,G,rpt) Prune messages again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add ability to upstream to know when to send S,G,rpt Prune
Donald Sharp [Tue, 7 Mar 2017 02:05:46 +0000 (21:05 -0500)]
pimd: Add ability to upstream to know when to send S,G,rpt Prune

Add flag to 'struct pim_upstream' to allow tracking of when
to send (S,G,rpt) Prune message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Ensure that *,G is first entry in srcs list
Donald Sharp [Tue, 7 Mar 2017 01:44:25 +0000 (20:44 -0500)]
pimd: Ensure that *,G is first entry in srcs list

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Optimize group size figuring out.
Donald Sharp [Fri, 17 Mar 2017 12:07:19 +0000 (08:07 -0400)]
pimd: Optimize group size figuring out.

We were figuring out the group size 2 times.  Figure it out
1 time and then pass it around.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #290 from bingen/fix_unused_func
Donald Sharp [Thu, 23 Mar 2017 16:37:02 +0000 (12:37 -0400)]
Merge pull request #290 from bingen/fix_unused_func

ldpd: Remove lde_release_label_chunk to avoid warnings

7 years agoldpd: Remove lde_release_label_chunk to avoid warnings
ßingen [Thu, 23 Mar 2017 16:35:48 +0000 (17:35 +0100)]
ldpd: Remove lde_release_label_chunk to avoid warnings

7 years agoMerge pull request #288 from bingen/fix_coverity_defects
Donald Sharp [Thu, 23 Mar 2017 13:39:15 +0000 (09:39 -0400)]
Merge pull request #288 from bingen/fix_coverity_defects

lm: Fix some errors detected by Coverity Scan

7 years agolm: Fix some errors detected by Coverity Scan
ßingen [Wed, 22 Mar 2017 10:34:10 +0000 (11:34 +0100)]
lm: Fix some errors detected by Coverity Scan

7 years agoMerge pull request #287 from donaldsharp/int_fix
Renato Westphal [Tue, 21 Mar 2017 17:59:52 +0000 (14:59 -0300)]
Merge pull request #287 from donaldsharp/int_fix

pimd: Fix interface api

7 years agopimd: Fix interface api
Donald Sharp [Tue, 21 Mar 2017 16:54:55 +0000 (12:54 -0400)]
pimd: Fix interface api

The interface api has change and the pim changes used
the old api.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #285 from bingen/label_manager_3
Donald Sharp [Tue, 21 Mar 2017 15:40:20 +0000 (11:40 -0400)]
Merge pull request #285 from bingen/label_manager_3

Implement generic label manager

7 years agoMerge pull request #280 from donaldsharp/more_pim
Jafar Al-Gharaibeh [Tue, 21 Mar 2017 15:34:40 +0000 (10:34 -0500)]
Merge pull request #280 from donaldsharp/more_pim

More pim

7 years agoMerge pull request #278 from donaldsharp/interfaces2
Renato Westphal [Tue, 21 Mar 2017 15:33:00 +0000 (12:33 -0300)]
Merge pull request #278 from donaldsharp/interfaces2

Interfaces2

7 years agoldpd: Fix compilation errors n Ubuntu CI
ßingen [Tue, 21 Mar 2017 11:44:10 +0000 (12:44 +0100)]
ldpd: Fix compilation errors n Ubuntu CI

Signed-off-by: ßingen <bingen@voltanet.io>
7 years agoldpd: Catch signal on reconnect
ßingen [Tue, 21 Mar 2017 11:06:58 +0000 (12:06 +0100)]
ldpd: Catch signal on reconnect

To be able to interrupt LDE when it's trying to reconnect to label
manager.

Signed-off-by: ßingen <bingen@voltanet.io>
7 years agoldpd: Fix bug in get label func
ßingen [Tue, 21 Mar 2017 08:11:15 +0000 (09:11 +0100)]
ldpd: Fix bug in get label func

Signed-off-by: ßingen <bingen@voltanet.io>
7 years agoldpd: provide more detailed information in some show commands
Renato Westphal [Sun, 19 Mar 2017 00:58:51 +0000 (21:58 -0300)]
ldpd: provide more detailed information in some show commands

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: change the sorting algorithm of adjacencies
Renato Westphal [Sat, 18 Mar 2017 20:05:35 +0000 (17:05 -0300)]
ldpd: change the sorting algorithm of adjacencies

Now the "show mpls ldp discovery" command will display all LDP
adjancencies sorted by address family, neighbor ID and then type (link
or targeted).

Example:
vtysh# show mpls ldp discovery
AF   ID              Type     Source           Holdtime
ipv4 3.3.3.3         Link     rt2-eth1               15
ipv4 3.3.3.3         Link     rt2-eth2               15
ipv4 4.4.4.4         Link     rt2-eth1               15
ipv6 1.1.1.1         Link     rt2-eth0               15
ipv6 3.3.3.3         Link     rt2-eth1               15
ipv6 3.3.3.3         Link     rt2-eth2               15
ipv6 4.4.4.4         Link     rt2-eth1               15

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: add commands to show sent/rcvd capabilities
Renato Westphal [Fri, 17 Mar 2017 23:55:42 +0000 (20:55 -0300)]
ldpd: add commands to show sent/rcvd capabilities

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: provide both a brief and a detailed version of some show commands
Renato Westphal [Fri, 17 Mar 2017 01:11:15 +0000 (22:11 -0300)]
ldpd: provide both a brief and a detailed version of some show commands

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoImplement generic label manager
ßingen [Mon, 20 Mar 2017 14:34:49 +0000 (15:34 +0100)]
Implement generic label manager

Label Manager allows to share MPLS label space among different
daemons. Each daemon can request a chunk of consecutive labels and
release it if it doesn't need them anymore. Label Manager stores the
daemon protocol and instance to identify the owner client. It uses them
to perform garbage collection, releasing all label chunks from a client
when it gets disconnected or reconnected.

Additionally, every client can request that the chunk is never garbage
collected. In that case client has the responsibility to release
non-used labels.

Zebra can host the label manager itself (if no -l param is provided) or
connect to an external one using zserv/zclient (providing its address
with -l param).

Client code is in lib/zclient.c, but currently only LDP is using it.

TODO: Allow for custom ranges requests, i.e., specify the start label
besides the chunk.
TODO: Release labels from LDP.

Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>
7 years agoMerge pull request #282 from opensourcerouting/ldpd-lspcheck
Donald Sharp [Mon, 20 Mar 2017 12:08:38 +0000 (08:08 -0400)]
Merge pull request #282 from opensourcerouting/ldpd-lspcheck

ldpd: remove pseudowire LSP check

7 years agoldpd: remove pseudowire LSP check
Renato Westphal [Fri, 17 Mar 2017 18:41:04 +0000 (15:41 -0300)]
ldpd: remove pseudowire LSP check

In order to bring a pseudowire up, we must make sure that there's at
least one LSP available to its remote end (otherwise the labeled frames
from the CEs wouldn't reach their destination). We were doing this
check in ldpd, but doing so is very limiting because it doesn't consider
other types of LSPs that might be available (static LSPs, RSVP-TE, SR,
etc). Thus remove this check from the l2vpn_pw_ok() function. Later
on we'll implement a pseudowire manager in zebra which will solve this
problem in a much better way (including notifying ldpd about failures
to install a pseudowire in the kernel/hardware).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agopimd: Add display of SGRpt state for ifchannel
Donald Sharp [Fri, 17 Mar 2017 17:46:47 +0000 (13:46 -0400)]
pimd: Add display of SGRpt state for ifchannel

When we get a SGrpt Prune embedded in the *,G Join,
Display the created ifchannel as being SGRpt state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix connected data structure not being freed
Donald Sharp [Fri, 17 Mar 2017 00:07:08 +0000 (20:07 -0400)]
pimd: Fix connected data structure not being freed

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix uninitialized access of req
Donald Sharp [Fri, 17 Mar 2017 00:06:31 +0000 (20:06 -0400)]
pimd: Fix uninitialized access of req

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup pim_register_recv upstream create
Donald Sharp [Thu, 16 Mar 2017 20:43:01 +0000 (16:43 -0400)]
pimd: Cleanup pim_register_recv upstream create

When we get a register packet from a FHR, we
were doing allot of work twice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup ref counting
Donald Sharp [Thu, 16 Mar 2017 19:56:54 +0000 (15:56 -0400)]
pimd: Cleanup ref counting

pim_jp_agg list should not ref count pim_upstream as that
the deletion of pim_upstream deletion should remove
the pim_upstream from the j/p agg list.

Cleanup a memory leag of jag

Make comparison of js cleaner in add_group

Move THREAD_OFF to before the neighbor find.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove dead code
Donald Sharp [Thu, 16 Mar 2017 19:52:36 +0000 (15:52 -0400)]
pimd: Remove dead code

This code is impossible to reach.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unused value
Donald Sharp [Thu, 16 Mar 2017 18:19:17 +0000 (14:19 -0400)]
pimd: Remove unused value

Dead code, remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unneeded debug statement
Donald Sharp [Thu, 16 Mar 2017 18:14:00 +0000 (14:14 -0400)]
pimd: Remove unneeded debug statement

Left over debug statement that is not needed anymore

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add code to catch J/P Agg list issues
Donald Sharp [Thu, 16 Mar 2017 16:56:59 +0000 (12:56 -0400)]
pimd: Add code to catch J/P Agg list issues

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: When the RPF is changed remove the group
Donald Sharp [Thu, 16 Mar 2017 12:38:03 +0000 (08:38 -0400)]
pimd: When the RPF is changed remove the group

When changing the RPF cleanup the old entry
in the J/P Agg neighbor list.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Consider interface change a RPF_CHANGED event
Donald Sharp [Thu, 16 Mar 2017 15:15:32 +0000 (11:15 -0400)]
pimd: Consider interface change a RPF_CHANGED event

Suppose you have a unnumbered ecmp connections between
two switches:

st1-l3# show ip pim neighbor
Interface         Neighbor    Uptime  Holdtime  DR Pri
swp52             6.0.0.10  00:00:01  00:00:29       1
swp53             6.0.0.10  00:00:06  00:00:26       1

And for a given (S,G) the RPF goes:
st1-l3# show ip nht
99.1.1.1
 resolved via bgp
 fe80::4e76:25ff:fee7:42d1, via swp52
 fe80::4e76:25ff:fee7:42d5, via swp53
 Client list: pim(fd 14)

Now suppose, 52 is the choosen RPF( since we can only pick one )
and the interface goes down.  As such we will choose to use
swp53.

The problem was that the pim_rpf_update call is made
it will change the rpf interface to 53, but not tell
the calling function that the RPF_CHANGED because
it is only looking at the rpf_addr(the nexthop)
to see if it is changed and if we are in an unnumbered
dual ecmp to the same box it was not detecting and
notifying.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup JP Agg a bit more
Donald Sharp [Fri, 10 Mar 2017 20:01:11 +0000 (15:01 -0500)]
pimd: Cleanup JP Agg a bit more

The J/P Aggregation + the NHT tracking code was not
playing nicely together

1) Clean up pim_upstream ref counting to keep a bit better
track of it.

2) When we delete pim_upstream zero it out to hopefully
catch issues faster in the future

3) Clean up J/P Agg source list a bit better to keep order

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remember to delete reference to upstream in failure
Donald Sharp [Tue, 14 Mar 2017 11:58:17 +0000 (07:58 -0400)]
pimd: Remember to delete reference to upstream in failure

When creating the pim upstream data structure, if we fail
to create remove the reference we saved to it on the side
in the pnc code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Carefully Reconstruct FHR state when interface bounces
Donald Sharp [Fri, 10 Mar 2017 15:26:00 +0000 (10:26 -0500)]
pimd: Carefully Reconstruct FHR state when interface bounces

When an interface bounces and we receive a packet before
pim has a chance to fully bring the 'struct pim_usptream'
back up correctly, first check to see if we already have
an associated data structure before creating it again.

This removes a case where both the c_oil and up ref counts
were being incremented and never removed properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add additional output to 'show ip pim state json'
Donald Sharp [Fri, 10 Mar 2017 15:23:40 +0000 (10:23 -0500)]
pimd: Add additional output to 'show ip pim state json'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Nexthop tracking support
Chirag Shah [Wed, 22 Feb 2017 15:28:36 +0000 (07:28 -0800)]
pimd: Nexthop tracking support

Add pim Nexthop tracking feature 1st part where, specific RP or Source address (unicast address)
register with Zebra. Once nexthop update received from Zebra for a given address, scan RP or upstream
entries impacted by the change in nexthop.

Reviewed By: CCR-5761, Donald Sharp <sharpd@cumulusnetworks.com>
Testing Done: Tested with multiple RPs and multiple *,G entries at LHR.
Add new Nexthop or remove one of the link towards RP and verify RP and upstream nexthop update.
similar test done at RP with multiple S,G entries to reach source.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agobgpd, lib, zebra: Rename if_update_vrf -> if_update
Donald Sharp [Wed, 15 Mar 2017 14:55:42 +0000 (10:55 -0400)]
bgpd, lib, zebra: Rename if_update_vrf -> if_update

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoldpd: Move if_update to ldp_if_update
Donald Sharp [Wed, 15 Mar 2017 14:49:21 +0000 (10:49 -0400)]
ldpd: Move if_update to ldp_if_update

The if_update function should be owned
by lib/if.h.  Move the function out of the
way so we can rename lib/if.h if_update_vrf -> if_update

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix non-Null Terminated help string
Donald Sharp [Sun, 12 Mar 2017 00:06:09 +0000 (19:06 -0500)]
zebra: Fix non-Null Terminated help string

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Some nexthop display code needs to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:56:55 +0000 (07:56 -0500)]
bgpd: Some nexthop display code needs to be VRF aware

When displaying nexthops we need to be able to handle
the correct VRF.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, lib, zebra: Refactor ifname2ifindex to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:52:59 +0000 (07:52 -0500)]
bgpd, lib, zebra: Refactor ifname2ifindex to be VRF aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Refactor ifindex2ifname to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:47:46 +0000 (07:47 -0500)]
*: Refactor ifindex2ifname to be VRF aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Refactor if_get_by_name_len to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:34:21 +0000 (07:34 -0500)]
lib: Refactor if_get_by_name_len to be VRF aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Refactor if_get_by_name to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:30:52 +0000 (07:30 -0500)]
*: Refactor if_get_by_name to be VRF aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Refactor if_lookup_by_name to be VRF aware
Donald Sharp [Sat, 11 Mar 2017 12:27:15 +0000 (07:27 -0500)]
*: Refactor if_lookup_by_name to be VRF aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, ospf6d: Refactor if_lookup_prefix
Donald Sharp [Sat, 11 Mar 2017 12:13:49 +0000 (07:13 -0500)]
lib, ospf6d: Refactor if_lookup_prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, ospfd: Refactor if_lookup_by_name_len
Donald Sharp [Sat, 11 Mar 2017 12:09:21 +0000 (07:09 -0500)]
lib, ospfd: Refactor if_lookup_by_name_len

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, ospfd, ripd: Convert if_lookup_address to be vrf aware
Donald Sharp [Fri, 10 Mar 2017 20:54:53 +0000 (15:54 -0500)]
lib, ospfd, ripd: Convert if_lookup_address to be vrf aware

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, pimd, zebra: Convert if_lookup_exact_address to VRF only
Donald Sharp [Fri, 10 Mar 2017 20:51:36 +0000 (15:51 -0500)]
lib, pimd, zebra: Convert if_lookup_exact_address to VRF only

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, ospfd, pimd: Convert to using VRF based interface creation
Donald Sharp [Fri, 10 Mar 2017 20:48:43 +0000 (15:48 -0500)]
lib, ospfd, pimd: Convert to using VRF based interface creation

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Remove non-vrf based ifindex lookup
Donald Sharp [Fri, 10 Mar 2017 20:45:28 +0000 (15:45 -0500)]
*: Remove non-vrf based ifindex lookup

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #270 from donaldsharp/cares
David Lamparter [Fri, 10 Mar 2017 19:53:42 +0000 (20:53 +0100)]
Merge pull request #270 from donaldsharp/cares

debian: Allow building the .deb to know about new dependency

7 years agoMerge pull request #271 from AnuradhaKaruppiah/master
David Lamparter [Fri, 10 Mar 2017 19:53:30 +0000 (20:53 +0100)]
Merge pull request #271 from AnuradhaKaruppiah/master

pimd: Separate the register and upstream join states

7 years agopimd: display reg-state and join-state info in the pim_upstream output
anuradhak [Thu, 9 Mar 2017 19:42:55 +0000 (11:42 -0800)]
pimd: display reg-state and join-state info in the pim_upstream output

Changed the state field in the "sh ip pim upstream" output to include
register and join state info as a comma separated value. Register info
is supressed if reg-state=NoInfo.

Sample output:
=============
root@fhr:/home/cumulus# net show pim upstream
Iif       Source          Group           State       Uptime   JoinTimer
RSTimer   KATimer   RefCnt
swp1      33.1.1.1        239.1.1.2       J,RegP      00:00:18 --:--:--
00:00:44  00:03:24       2
root@fhr:/home/cumulus#

root@rp:/home/cumulus# net show pim upstream
Iif       Source          Group           State       Uptime   JoinTimer
RSTimer   KATimer   RefCnt
lo        *               239.1.1.2       J           00:02:08 00:00:52
--:--:--  --:--:--       1
swp1      33.1.1.1        239.1.1.2       J           00:00:16 00:00:11
--:--:--  00:03:26       1
root@rp:/home/cumulus#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: pim-smoke

7 years agopimd: simplify pim upstream state transitions
anuradhak [Thu, 9 Mar 2017 18:47:50 +0000 (10:47 -0800)]
pimd: simplify pim upstream state transitions

This is another follow-up change to the reg-state and up-join-state
separation. The upstream join state machine can now respond to
JoinDesired macro changes independent of router role.

I have also dropped the PRUNE state from the upstream-join-state
enumeration. RFC4601 only defines JOINED and NOTJOINED states. And PRUNE
can really be replace by NOTJOINED.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: Register state machine in FHR only, combined FHR-RP and
FHR-RP-LHR/all-in-one setups. Also ran pim-smoke.

7 years agopimd: add new/distinct enumeration for pim register state
anuradhak [Thu, 9 Mar 2017 17:52:59 +0000 (09:52 -0800)]
pimd: add new/distinct enumeration for pim register state

With the separation of register-state and upstream-join-state we no
longer need an enumeration that covers both states. This commit includes
the following -
1. Defined new enumeration for reg state (this 1:1 with RFC4601).
2. Dropped JOIN_PENDING enum value from upstream join state. RFC4601
only define two values NOT_JOINED and JOINED for this state.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: Verified register setup manually and ran pim-smoke

7 years agopimd: Separate the register and upstream join states on the FHR
anuradhak [Wed, 8 Mar 2017 17:29:40 +0000 (09:29 -0800)]
pimd: Separate the register and upstream join states on the FHR

On the FHR upstream-join-state is not particularly relevant as we
don't need to send upstream JPs for the SG. So that field was being
overloaded with the register-state. However some of the events that
triggered changes to the JoinDesired macro were accidentally overwriting
the state with join info (instead of treating it as register info)
confusing the register state machine.

To make the PIM RFC macros' implemention simple I have separated out
the register-state. And upstream->state now solely describes the
upstream-join-state independent of the role of the PIM router.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: verified pim-register state-machine with separate and
combined FHR/RP routers. Also ran pim-smoke.

7 years agodebian: Allow building the .deb to know about new dependency
Donald Sharp [Fri, 10 Mar 2017 18:02:09 +0000 (13:02 -0500)]
debian: Allow building the .deb to know about new dependency

libc-ares-dev and libc-ares2 are now dependencies to build nhrpd

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #269 from donaldsharp/libfrr
David Lamparter [Fri, 10 Mar 2017 13:29:58 +0000 (14:29 +0100)]
Merge pull request #269 from donaldsharp/libfrr

lib: Fix missed code

7 years agolib: Fix missed code
Donald Sharp [Thu, 9 Mar 2017 21:31:44 +0000 (16:31 -0500)]
lib: Fix missed code

When converting to new format we missed some code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'stable/2.0'
David Lamparter [Fri, 10 Mar 2017 13:20:40 +0000 (14:20 +0100)]
Merge branch 'stable/2.0'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agomerge: pre-revert inapplicable changes
David Lamparter [Fri, 10 Mar 2017 13:16:37 +0000 (14:16 +0100)]
merge: pre-revert inapplicable changes

The following changes do not apply on master because the code has
changed:

- "vtysh: fix completion"
  reverts commit 09e61a383facd3c9e3e52162e98302c7cba15ecc.
- "Revert "lib: Fix tab completions memleak, memory stats corruption""
  reverts commit 4dcee34bd603645e53f8a8265dd263a85422b63d.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #266 from donaldsharp/nht
David Lamparter [Fri, 10 Mar 2017 13:10:10 +0000 (14:10 +0100)]
Merge pull request #266 from donaldsharp/nht

bug fixes

7 years agozebra: Fix specific prefix handling
Donald Sharp [Fri, 10 Mar 2017 00:37:23 +0000 (19:37 -0500)]
zebra: Fix specific prefix handling

Suppose we are handling the process_workq and either a new static
route is installed or a Routing Protocol installs a new route.
We will call evaluate_rnh with a specific prefix.  We might
have a situation where we clear the NHC flag prematurely.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #267 from opensourcerouting/vty-completion-again
Donald Sharp [Thu, 9 Mar 2017 20:34:57 +0000 (15:34 -0500)]
Merge pull request #267 from opensourcerouting/vty-completion-again

vty completion memory counting redux

7 years agolib: handle case specifc types, protect against double free (issue #144)
Lou Berger [Wed, 8 Mar 2017 17:14:15 +0000 (12:14 -0500)]
lib: handle case specifc types, protect against double free (issue #144)

Signed-off-by: Lou Berger <lberger@labn.net>
[DL: dropped changes except the two NULL assignments]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoRevert "lib: Fix tab completions memleak, memory stats corruption"
David Lamparter [Thu, 9 Mar 2017 18:23:00 +0000 (19:23 +0100)]
Revert "lib: Fix tab completions memleak, memory stats corruption"

This reverts commit 039dc61292de5f3ed5f46316b1940ab6bb184c3f.

The patch actually made the situation worse since the return value from
cmd_complete_command_real() was now inconsistently allocated from
different memory stat pools.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoLowercase frr.conf
Martín Beauchamp [Mon, 27 Feb 2017 18:26:20 +0000 (13:26 -0500)]
Lowercase frr.conf

7 years agozebra: Notify all nexthops that we've changed
Donald Sharp [Tue, 7 Mar 2017 20:13:04 +0000 (15:13 -0500)]
zebra: Notify all nexthops that we've changed

Zebra when it was scanning the tree would unset NEXTHOPS_CHANGED
after the first notification.  If the route we are notifying because
of covers multiple interesting nexthops then we would be unable
to know that we need to notify for that one as well because of
the flag removal.

Ticket: CM-15157
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #263 from opensourcerouting/assorted-20170308
Donald Sharp [Thu, 9 Mar 2017 11:52:56 +0000 (06:52 -0500)]
Merge pull request #263 from opensourcerouting/assorted-20170308

assorted bits

7 years agopimd: fix clang warning
David Lamparter [Wed, 8 Mar 2017 15:37:42 +0000 (16:37 +0100)]
pimd: fix clang warning

pimd/pim_sock.c:178:13: error: implicit conversion from
'int' to 'char' changes value from 148 to -108
[-Werror,-Wconstant-conversion]
    ra[0] = 148;

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agowatchfrr: make min/max restart interval longopts
David Lamparter [Wed, 8 Mar 2017 15:22:43 +0000 (16:22 +0100)]
watchfrr: make min/max restart interval longopts

-m/-M seem to be seldomly used...
... and I kindof need/want -M for module loading.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix some user-visible Quagga remnants
David Lamparter [Wed, 8 Mar 2017 15:13:12 +0000 (16:13 +0100)]
*: fix some user-visible Quagga remnants

(Note: the allow_delete thing is called "zebra" on the commandline
because that's the clearest context there, while it is called "FRR" in
the CLI because that's considerably less confusing in a vtysh env.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoisisd: remove reload-by-reexec
David Lamparter [Wed, 8 Mar 2017 15:03:35 +0000 (16:03 +0100)]
isisd: remove reload-by-reexec

This is a quite horrible mechanism...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>