]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Thu, 2 Feb 2017 15:42:51 +0000 (10:42 -0500)]
Merge remote-tracking branch 'origin/stable/2.0'

7 years agoMerge pull request #135 from LabNConsulting/working/master/patch-set/misc+vrf
Donald Sharp [Thu, 2 Feb 2017 14:25:24 +0000 (09:25 -0500)]
Merge pull request #135 from LabNConsulting/working/master/patch-set/misc+vrf

Master: misc vnc/rfapi and VRF

7 years agoMerge pull request #154 from LabNConsulting/working/master/patch-set/rr-part2
Donald Sharp [Thu, 2 Feb 2017 12:49:43 +0000 (07:49 -0500)]
Merge pull request #154 from LabNConsulting/working/master/patch-set/rr-part2

Mater: complete Issue#91 fix (regression now clean)

7 years agoMerge pull request #153 from LabNConsulting/working/2.0/patch-set/rr-part2
Donald Sharp [Thu, 2 Feb 2017 12:48:45 +0000 (07:48 -0500)]
Merge pull request #153 from LabNConsulting/working/2.0/patch-set/rr-part2

2.0: complete Issue#91 fix (regression now clean)

7 years agoMerge pull request #143 from LabNConsulting/working/2.0/patch/mpls-tt
Donald Sharp [Thu, 2 Feb 2017 12:47:43 +0000 (07:47 -0500)]
Merge pull request #143 from LabNConsulting/working/2.0/patch/mpls-tt

2.0: bgp rfapi: fix resolution / lookup failure when using MPLS TT

7 years agoMerge pull request #151 from opensourcerouting/ldpd-filtering
Donald Sharp [Thu, 2 Feb 2017 12:45:08 +0000 (07:45 -0500)]
Merge pull request #151 from opensourcerouting/ldpd-filtering

ldpd: introduce advanced filtering capabilities

7 years agobgpd rfapi: small debug log enhancements
G. Paul Ziemba [Thu, 2 Feb 2017 00:24:32 +0000 (16:24 -0800)]
bgpd rfapi: small debug log enhancements

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd rfapi: RR replated (Issue #91) treat filtered update
G. Paul Ziemba [Thu, 2 Feb 2017 00:13:33 +0000 (16:13 -0800)]
bgpd rfapi: RR replated (Issue #91) treat filtered update
     as implicit withdraw for rfapi

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd rfapi: RR replated (Issue #91) treat filtered update
G. Paul Ziemba [Thu, 2 Feb 2017 00:13:33 +0000 (16:13 -0800)]
bgpd rfapi: RR replated (Issue #91) treat filtered update
     as implicit withdraw for rfapi

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agoldpd: introduce advanced filtering capabilities
Renato Westphal [Fri, 27 Jan 2017 16:22:47 +0000 (14:22 -0200)]
ldpd: introduce advanced filtering capabilities

This patch introduces several new configuration commands to ldpd. These
commands should allow the operator to define advanced filtering policies
for things like label advertisement, label allocation, etc.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: add synchronous IPC channels
Renato Westphal [Wed, 1 Feb 2017 11:51:54 +0000 (09:51 -0200)]
ldpd: add synchronous IPC channels

By default all ldpd interprocess communication is asynchronous
(non-blocking socketpairs). Under some circumstances, however, we'll
need synchronous IPC as well. Examples:
* the lde child process requesting labels to zebra (through the parent
  process);
* apply an access-list on a given IP prefix (ACLs are only available in
  the parent process).

This patch only adds the necessary infrastructure to allow the child
processes to make synchronous requests to the parent process. Later
patches will make use of this new infrastructure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix a bug in the explicit-null command
Renato Westphal [Wed, 1 Feb 2017 15:03:53 +0000 (13:03 -0200)]
ldpd: fix a bug in the explicit-null command

Be more clever and update the label of the connected routes just once upon
a configuration change. This is not only more efficient but also fixes
a bug where no labels were updated when we didn't have any neighbors.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #146 from opensourcerouting/assorted-stable
Donald Sharp [Wed, 1 Feb 2017 15:52:21 +0000 (10:52 -0500)]
Merge pull request #146 from opensourcerouting/assorted-stable

assorted fixes for stable/2.0

7 years agoldpd: release all memory explicitly on exit
Renato Westphal [Fri, 27 Jan 2017 22:01:35 +0000 (20:01 -0200)]
ldpd: release all memory explicitly on exit

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix wrong asserts in netlink code
Renato Westphal [Fri, 27 Jan 2017 20:18:13 +0000 (18:18 -0200)]
zebra: fix wrong asserts in netlink code

These new asserts were causing zebra to abort when trying to install
MPLS labeled routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: remove unnecessary variable
Renato Westphal [Fri, 27 Jan 2017 20:16:31 +0000 (18:16 -0200)]
lib: remove unnecessary variable

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix SEGV on exit or vrf delete
David Lamparter [Wed, 1 Feb 2017 14:33:55 +0000 (15:33 +0100)]
zebra: fix SEGV on exit or vrf delete

table->info must be free'd last, it's used in rib_unlink().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: clear bgp_master at exit to help valgrind
David Lamparter [Wed, 1 Feb 2017 12:40:00 +0000 (13:40 +0100)]
bgpd: clear bgp_master at exit to help valgrind

bgp_master can retain pointers keeping allocated structures "reachable"
in valgrind.  Clear to 0 to tell valgrind that everything should've been
freed really.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: clean up dump config at exit
David Lamparter [Wed, 1 Feb 2017 12:39:26 +0000 (13:39 +0100)]
bgpd: clean up dump config at exit

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: plug leak in prefix_list_delete()
David Lamparter [Wed, 1 Feb 2017 12:21:40 +0000 (13:21 +0100)]
lib: plug leak in prefix_list_delete()

prefix_list_delete wasn't releasing chained trie entries, only the main
one.  Just call the proper trie_del.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: fpm: fix --enable-dev-build
David Lamparter [Mon, 23 Jan 2017 22:32:01 +0000 (23:32 +0100)]
zebra: fpm: fix --enable-dev-build

I guess no one uses --enable-dev-build...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix warning fallout from set_socket_path
David Lamparter [Wed, 1 Feb 2017 12:12:16 +0000 (13:12 +0100)]
*: fix warning fallout from set_socket_path

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgp rfapi: fix resolution / lookup failure when using MPLS TT
Lou Berger [Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)]
bgp rfapi: fix resolution / lookup failure when using MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgp rfapi: fix resolution / lookup failure when using MPLS TT
Lou Berger [Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)]
bgp rfapi: fix resolution / lookup failure when using MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoMerge pull request #139 from opensourcerouting/cli_merge_prep_final
Donald Sharp [Tue, 31 Jan 2017 18:27:42 +0000 (13:27 -0500)]
Merge pull request #139 from opensourcerouting/cli_merge_prep_final

CLI split merge-step preparations

7 years agoMerge pull request #98 from opensourcerouting/feature/zebra-srcdest
Donald Sharp [Tue, 31 Jan 2017 17:29:00 +0000 (12:29 -0500)]
Merge pull request #98 from opensourcerouting/feature/zebra-srcdest

feature/zebra-srcdest

7 years agoMerge pull request #140 from opensourcerouting/fixes/isis-subtlv
Donald Sharp [Tue, 31 Jan 2017 17:28:40 +0000 (12:28 -0500)]
Merge pull request #140 from opensourcerouting/fixes/isis-subtlv

isisd: parse TE-IP reachability and IPv6 reachability subtlvs

7 years agoMerge branch 'master' into feature/zebra-srcdest
Christian Franke [Tue, 31 Jan 2017 15:22:54 +0000 (16:22 +0100)]
Merge branch 'master' into feature/zebra-srcdest

7 years agoisisd: parse TE-IP reachability and IPv6 reachability subtlvs
Christian Franke [Tue, 31 Jan 2017 15:10:25 +0000 (16:10 +0100)]
isisd: parse TE-IP reachability and IPv6 reachability subtlvs

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agotests/testcli: cleanup at exit
David Lamparter [Thu, 26 Jan 2017 20:57:58 +0000 (21:57 +0100)]
tests/testcli: cleanup at exit

Call the proper termination functions so we can see memory leaks.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: move at_close call in vty_stdio to end
David Lamparter [Thu, 26 Jan 2017 21:09:37 +0000 (22:09 +0100)]
lib: move at_close call in vty_stdio to end

Since the at_close call for the stdio vty might exit() the process, move
it to the end of the function, after freeing all memory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib/tests: add cmd_hostname_set()
David Lamparter [Thu, 26 Jan 2017 20:57:46 +0000 (21:57 +0100)]
lib/tests: add cmd_hostname_set()

To make it possible for testcli to get a clean memory management bill.
(Note: XFREE() is NULL-safe, just like free().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: add vector_unset_value()
David Lamparter [Wed, 25 Jan 2017 03:13:02 +0000 (04:13 +0100)]
lib: add vector_unset_value()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: clean up tab-completion memory counting
David Lamparter [Thu, 26 Jan 2017 20:57:24 +0000 (21:57 +0100)]
lib: clean up tab-completion memory counting

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: fix allocation counting
David Lamparter [Thu, 26 Jan 2017 21:19:32 +0000 (22:19 +0100)]
lib: parser: fix allocation counting

command_lex.l was allocating as MTYPE_TMP, while command_parse.y would
just call free().  Make both use MTYPE_LEX.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'frr/pull/133' ("Pim cleanup")
David Lamparter [Tue, 31 Jan 2017 14:26:07 +0000 (15:26 +0100)]
Merge branch 'frr/pull/133' ("Pim cleanup")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: Do not force NEXTHOP_TYPE to XXX_IFINDEX
Donald Sharp [Tue, 31 Jan 2017 12:36:57 +0000 (07:36 -0500)]
zebra: Do not force NEXTHOP_TYPE to XXX_IFINDEX

The original goal of the zebra change was to force all:
NEXTHOP_TYPE_IPV4 -> NEXTHOP_TYPE_IPV4_IFINDEX
NEXTHOP_TYPE_IPV6 -> NEXTHOP_TYPE_IPV6_IFINDEX

This causes issues in routes being installed into the kernel
backing this out until I can get time to fully understand
what is going wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'pull/134' with changes
David Lamparter [Tue, 31 Jan 2017 12:53:15 +0000 (13:53 +0100)]
Merge branch 'pull/134' with changes

One commit reverted.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoRevert "*: Add source of route as protocol string in ip route pushed into kernel"
David Lamparter [Tue, 31 Jan 2017 12:51:27 +0000 (13:51 +0100)]
Revert "*: Add source of route as protocol string in ip route pushed into kernel"

This reverts commit 1a11782c408a60afb464fe232fc2e3fa1e298436.

The change is not suitable for stable/2.0, it's not a bugfix and has
quite a visible user impact.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'frr/pull/137'
David Lamparter [Tue, 31 Jan 2017 12:50:05 +0000 (13:50 +0100)]
Merge branch 'frr/pull/137'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'frr/pull/136' ("misc vnc/rfapi fixes")
David Lamparter [Tue, 31 Jan 2017 12:38:46 +0000 (13:38 +0100)]
Merge branch 'frr/pull/136' ("misc vnc/rfapi fixes")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'frr/pull/132' ("grabbag")
David Lamparter [Tue, 31 Jan 2017 12:03:07 +0000 (13:03 +0100)]
Merge branch 'frr/pull/132' ("grabbag")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib, bgpd: fix miscellaneous route-map commands
Quentin Young [Mon, 30 Jan 2017 19:49:24 +0000 (19:49 +0000)]
lib, bgpd: fix miscellaneous route-map commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd rfapi: fix UN address in show with MPLS TT
Lou Berger [Sun, 29 Jan 2017 13:15:23 +0000 (08:15 -0500)]
bgpd rfapi: fix UN address in show with MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: pass received label on resolved NVE imports
Lou Berger [Sun, 29 Jan 2017 00:21:03 +0000 (19:21 -0500)]
bgpd rfapi: pass received label on resolved NVE imports

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: only auto add default tunnel type for local registrations
Lou Berger [Sat, 28 Jan 2017 23:57:28 +0000 (18:57 -0500)]
bgpd rfapi: only auto add default tunnel type for local registrations

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: reenable nexthop vrf-policy to suppory VRF controller use case
Lou Berger [Sun, 29 Jan 2017 15:10:23 +0000 (10:10 -0500)]
bgpd: reenable nexthop vrf-policy to suppory VRF controller use case

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: fix add vrf optional parameter parsing
Lou Berger [Sat, 28 Jan 2017 23:56:43 +0000 (18:56 -0500)]
bgpd: fix add vrf optional parameter parsing

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: fix UN address in show with MPLS TT
Lou Berger [Sun, 29 Jan 2017 13:15:23 +0000 (08:15 -0500)]
bgpd rfapi: fix UN address in show with MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: pass received label on resolved NVE imports
Lou Berger [Sun, 29 Jan 2017 00:21:03 +0000 (19:21 -0500)]
bgpd rfapi: pass received label on resolved NVE imports

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: only auto add default tunnel type for local registrations
Lou Berger [Sat, 28 Jan 2017 23:57:28 +0000 (18:57 -0500)]
bgpd rfapi: only auto add default tunnel type for local registrations

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoMerge pull request #128 from donaldsharp/readme
Russ White [Mon, 30 Jan 2017 23:09:52 +0000 (18:09 -0500)]
Merge pull request #128 from donaldsharp/readme

*: Update README

7 years agozebra: pass correct parameters to remove static routes with tags
Don Slice [Thu, 26 Jan 2017 20:49:00 +0000 (12:49 -0800)]
zebra: pass correct parameters to remove static routes with tags

Problem found in testing where certain "no ip route ... tag x" commands
would fail.  This was due to a change in tag processing where the tag
value is validated and previously some of the parameters were passed
incorrectly.  This caused the validation to fail.  This change ensures
the correct parameters are passed for evaluation as tags.  Manual testing
completed and the previously failing test now passes.  bgp and ospf smoke
tests will also be performed before pushing.

Ticket: CM-14605
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-5627
7 years agotools: Silly typo in regex for catching ip route syntax
Dinesh G Dutt [Wed, 25 Jan 2017 19:55:02 +0000 (11:55 -0800)]
tools: Silly typo in regex for catching ip route syntax

Ticket: CM-14600
Reviewed By: CCR-5615
Testing Done: Verifying the issue with/without the fix

I had intended the regexp to catch both ip and ipv6 routes, but somewhere
along the way, I left out the grouping in the regexp to catch if it was
ip or ipv6 at the start. This caused all the rest of the matches and replaces
to be off causing the issue reported by the bug.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agozebra: send ipv4 singlepath delete messages to kernel without nexthop
Don Slice [Fri, 13 Jan 2017 19:23:03 +0000 (11:23 -0800)]
zebra: send ipv4 singlepath delete messages to kernel without nexthop

Problem reported was stale routes left in the kernel in certain cases
when overlapping static routes were used and links were bounced.  The
problem was determined to be an issue where the nexthop was changed
due to recursion as the link is going down, and the next-hop at the
time of deletion doesn't match what was previously installed by the
kernel.  This caused the kernel to reject the deletion and the route
stuck around.

It was pointed out that the kernel doesn't actually require a next-hop
value on the netlink deletion call.  In this fix, we are eliminating
the nexthop for RTM_DELROUTE messages to the kernel in the ipv4 singlepath
case.  This approach could also be valid for other cases but the fix
as is resolved the reported failure case.  More testing should be
performed before similar changes are made for other cases.

Testing included manual testing for the failure condition as well as
complete bgp-smoke and ospf-smoke tests with no new failures.

Ticket: CM-13328
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-5562
7 years agobgpd: timers config is accepted but not recorded in running config
Daniel Walton [Fri, 20 Jan 2017 04:17:09 +0000 (04:17 +0000)]
bgpd: timers config is accepted but not recorded in running config

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14463

7 years agobgpd: Update BFD status when de-registering with PTM
radhika [Thu, 19 Jan 2017 22:23:21 +0000 (14:23 -0800)]
bgpd: Update BFD status when de-registering with PTM

Ticket: CM-14301
Reviewed By: Donald, Vivek
Testing Done: Unit, Min tests, PTM and BFD Smoke, BGP Smoke

Issue: BFD status is not changed from up to down for bgp peer even after the BFD session has been de-registered by bgpd.

Root Cause:  This issue happens when bgpd detects peer down before getting the BFD down from PTM. bgpd will send the de-reg bfd session message to ptm  after detecting peer down. If ptm receives the de-reg message before it detects the peer down, then the down message will not be sent to Quagga. This causes the bfd status in bgpd to remain unchanged.

Fix: Update the BFD status to down in bgpd before de-registering the session from PTM.

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
7 years agobgpd: Add decoded notification code strings to JSON output
Dinesh G Dutt [Mon, 16 Jan 2017 14:24:09 +0000 (06:24 -0800)]
bgpd: Add decoded notification code strings to JSON output

Ticket: CM-14136
Reviewed By: CCR-5585
Testing Done: bgpmin

The JSON output of 'bgp neighbor show' lacked the decoded strings for
the last notification error code/subcode. Decoding these strings outside
quagga is painful, and then needs to match with any updates to the codes
from RFCs/drafts. Further, all apps that look to understanding this need
to then add their own decoders for these strings.

Just add the decoded strings to the JSON output as well. JSON key name
for this is 'lastNotificationReason'.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years ago*: Add source of route as protocol string in ip route pushed into kernel
Dinesh G Dutt [Wed, 11 Jan 2017 22:33:39 +0000 (14:33 -0800)]
*: Add source of route as protocol string in ip route pushed into kernel

Ticket: CM-14313
Reviewed By:
Testing Done: bgpmin, ospfmin, bgp_kitchen_sink_test

'ip route show' displays all routes as belonging to protocol zebra.
The user has to run an additional command (in vtysh) to get the actual
source of a route (bgp/ospf/static etc.). This patch addresses that by
pushing the appropriate protocol string into the protocol field of the
netlink route update message. Now you can see routes with the correct
origin as well as filter on them (ip route show proto ospf).

'ospf' is used for both IPv4 and IPv6 routes, even though the OSPF
version is different in both cases.

Sample output (old):
9.9.12.13 via 69.254.2.38 dev swp3.2  proto zebra  metric 20
9.9.13.3  proto zebra  metric 20
        nexthop via 69.254.2.30  dev swp1.2 weight 1
        nexthop via 69.254.2.34  dev swp2.2 weight 1
        nexthop via 69.254.2.38  dev swp3.2 weight 1

Sample output (new):
9.9.12.13 via 69.254.2.38 dev swp3.2  proto bgp  metric 20
9.9.13.3  proto bgp  metric 20
        nexthop via 69.254.2.30  dev swp1.2 weight 1
        nexthop via 69.254.2.34  dev swp2.2 weight 1
        nexthop via 69.254.2.38  dev swp3.2 weight 1

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agotools: Fix unbound newaddr variable, fix too-broad except clauses
Dinesh G Dutt [Wed, 11 Jan 2017 19:33:15 +0000 (11:33 -0800)]
tools: Fix unbound newaddr variable, fix too-broad except clauses

Ticket: CM-14351
Reviewed By: dwalton
Testing Done:attempts to run NCLU test failed, Daniel verified.

Uninit variable bug, plus missed adding ValueError to the except
clauses in a couple of places.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agotools: Normalize prefix-lists and IP networks for avoiding unnecessary reload
Dinesh G Dutt [Sun, 8 Jan 2017 15:08:12 +0000 (07:08 -0800)]
tools: Normalize prefix-lists and IP networks for avoiding unnecessary reload

Ticket: CM-14280, CM-14281, CM-14286
Reviewed By: CCR-5546
Testing Done: quagga_service_test, bgp_enhe, bgp_vrf etc.

If the user specifies a network statement such as "network 1.1.1.1/24",
the running config shows this as "network 1.1.1.0/24" which causes
unnecessary withdrawl of the prefix and re-advertisement causing
perturbations. The same thing applies to prefix-lists and of course, IPv6
addresses.

IPv6 addresses were being normalized already, and so we use that same
function to handle the IPv6 portion of the issue. Interestingly community
strings were also getting ensnared in the normalized IPv6 function due to
the presence of ':', but thats OK.

quagga's running config changes 'null0' and 'blackhole' keywords into 'Null0'.
For example: ip route 10.1.1.0/24 blackhole' is displayed as
'ip route 10.1.1.0/24 Null0'. Reload mistakes this and issues a delete of the
Null0 route followed by an add of the "blackhole" route. Unnecessary, and
results in unexpected routing perturabations.

Also fix prefix-list's le/ge behavior: It always prints ge first even if the
user has specified le followed by ge, and it doesn't print l3 32/128 if ge
is also specified, else it prints them.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agobgpd: do not allow prefix length on update-source
Don Slice [Thu, 5 Jan 2017 18:49:23 +0000 (10:49 -0800)]
bgpd: do not allow prefix length on update-source

A common misconfiguration that was silently accepted but wouldn't work
was including the prefix length on the update-source; i.e. 10.1.1.1/32.
This commit rejects this config and notifies the user.

Ticket: CM-13485
Signed-off-by: Don Slice <dslice@cumulusnetworks.com.
Reviewed-by: Donald Sharp
7 years agoFRR: Add various TAGS format files to be ignored by git.
Dinesh G Dutt [Sun, 8 Jan 2017 00:44:55 +0000 (16:44 -0800)]
FRR: Add various TAGS format files to be ignored by git.

Add some missing files to .gitignore

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agotools: Handle deletes of entire interface context as deleting each line
Dinesh G Dutt [Fri, 6 Jan 2017 22:52:25 +0000 (14:52 -0800)]
tools: Handle deletes of entire interface context as deleting each line

Ticket: CM-14260
Reviewed By: CCR-14260
Testing Done: quagga reload tests (quagga_service, bgp_enhe etc.)

Quagga reload handles deletes of entire context by issuing a "no.." on the
entire context itself instead of deleting each individual line of the context.
However, this doesn't work when the context is "interface" since its not
allowed to do "no interface <ifname>" inside quagga. So special case this by
deleting each individual line of the context.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agotools: Handle lack of "seq" in prefix-list statements.
Dinesh G Dutt [Fri, 6 Jan 2017 14:50:47 +0000 (06:50 -0800)]
tools: Handle lack of "seq" in prefix-list statements.

Ticket: CM-14259
Reviewed By: CCR-5527
Testing Done:

If users specify "ip prefix-list FOO permit 1.2.3.4/24", running config
displays that line as "ip prefix-list FOO seq 5 permit 1.2.3.4/24", which
causes reload to delete the running config line and add back the one in
the config.

This patch fixes that.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agotools: Don't overwrite Quagga.conf on reload, unless user specified.
Dinesh G Dutt [Fri, 6 Jan 2017 02:49:13 +0000 (18:49 -0800)]
tools: Don't overwrite Quagga.conf on reload, unless user specified.

Ticket: CM-14059
Reviewed By: CCR-5524
Testing Done: the usual

At some point in the 3.x release cycle, it was decided to overwrite the
user's Quagga.conf configuration file with the output of running config
when the user did a quagga reload. This is problematic for several reasons
such as: losing user-specified comments, upsetting network automation
scripts which think some thing has changed all the time from the specified
config etc.

This patch fixes this issue by not overwriting the Quagga.conf file unless
the user specifies it via an additional option, or the file being used as
input to quagga reload isn't the default configuration file (incl. path).

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agobgpd, zebra: Fix for ignored non-default VRF single-hop BFD status messages in Quagga
radhika [Fri, 6 Jan 2017 20:54:25 +0000 (12:54 -0800)]
bgpd, zebra: Fix for ignored non-default VRF single-hop BFD status messages in Quagga

Ticket: CM-13425
Reviewed By: Donald, Kanna
Testing Done: Unit, Min tests, PTM Smoke and Nightly, BGP Smoke

Issue: BFD status up/down not reflected in the Quagga for non-default VRF single-hop BFD sessions.

Root Cause: PTM doesn’t keep track of VRF for Single hop BFD sessions since they are interface-based sessions. The status up/down messages to the quagga for single hop sessions do not have VRF information. In zebra daemon, the interface search based on the interface name extracted from the BFD status message is done across all VRFs. So, the search does not fail in zebra daemon. But, the interface search in bgpd/ospd is done per vrf and default VRF is used for search if no VRF is sent in the status message. So, the search fails and the BFD status changes are ignored.

Fix: The VRF information is extracted from the interface if VRF is not sent in the BFD status messages in zebra daemon and passed to bgpd/ospfd. The interface search will not fail since the appropriate VRF is passed to bgpd/ospfd and BFD satus changes are not ignored.

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
7 years agotools: Fix unnecessary routing perturbations due to old style config
Dinesh G Dutt [Tue, 13 Dec 2016 10:46:52 +0000 (02:46 -0800)]
tools: Fix unnecessary routing perturbations due to old style config

Ticket: CM-14060
Reviewed By:
Testing Done:

There are two harmful problems (cause routing changes in the network) with the
2.5.x style config:
    one with the old style specification of "multipath as-relax", and
    the other with ip import-table, used by redistribute neighbor

In 2.5, we had the user specify 'no-as-set' as the suffix to
'bgp bestpath as-path multipath relax' to avoid quagga's default behavior
which'd cause weird routing problems. However, in 3.x, we made 'no-as-set' as
the default, and so its neither required to specify it nor is it shown in the
running config. This means when we do quagga reload, we remove the multipath
as-relax line and add it back with the no-as-set line. This causes all BGP
sessions to be reset.

The problem with the "ip import-table" is that it causes us to unimport the
routes and then add it back again, causing routing prefix changes throughout
the network, potentially causing blackholing of traffic.

This fix addresses both these issues and avoids the unnecessary routing blips.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
7 years agoMerge pull request #127 from LabNConsulting/working/master/patch/assert-dup-free
Donald Sharp [Mon, 30 Jan 2017 18:07:44 +0000 (13:07 -0500)]
Merge pull request #127 from LabNConsulting/working/master/patch/assert-dup-free

lib: assert on duplicate free (count)

7 years agopimd: Fix handling of *,G on RP to allow prune of S,G to go out
Donald Sharp [Tue, 24 Jan 2017 21:11:40 +0000 (16:11 -0500)]
pimd: Fix handling of *,G on RP to allow prune of S,G to go out

When on the RP we received a prune *,G for an established S,G
If join_desired is no longer true we need to prune and
reset some timers, in addition to removing the inherited
interface from the olist.

This was not happening because we were just removing
the inherited oif from the *,G.

Ticket: CM-14561
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup shutdown a bit more.
Donald Sharp [Mon, 12 Dec 2016 00:02:46 +0000 (19:02 -0500)]
pimd: Cleanup shutdown a bit more.

Cleanup the shutdown of pim a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup uninitialized memory access
Donald Sharp [Mon, 12 Dec 2016 00:28:08 +0000 (19:28 -0500)]
pimd: Cleanup uninitialized memory access

Valgrind noticed that we have a read of uninitialized memory:

Conditional jump or move depends on uninitialised value(s)
==13749==    at 0x428067: pim_ifassert_winner_set (pim_assert.c:57)
==13749==    by 0x4266F0: pim_ifchannel_add (pim_ifchannel.c:535)
==13749==    by 0x426CC1: pim_ifchannel_join_add (pim_ifchannel.c:730)
==13749==    by 0x427B5B: recv_join (pim_join.c:95)
==13749==    by 0x427B5B: pim_joinprune_recv (pim_join.c:270)
==13749==    by 0x42354F: pim_pim_packet (pim_pim.c:249)
==13749==    by 0x4236C0: pim_sock_read (pim_pim.c:349)
==13749==    by 0x4E60587: thread_call (thread.c:1462)
==13749==    by 0x40C75E: main (pim_main.c:266)
==13749==

This commit fixes that issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Modify pimreg creation
Donald Sharp [Fri, 27 Jan 2017 00:14:06 +0000 (19:14 -0500)]
pimd: Modify pimreg creation

We were creating the pimreg device with a
created ifindex of 255.  This was causing
issues when a interface was assigned a ifindex
of 255 by the kernel.  Subsuquently pim
would stay in a hosed up state.

Modify the ifindex used for the pimreg device
to be 0.

Ticket: CM-14625
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Use correct flag to add an oif
Donald Sharp [Wed, 25 Jan 2017 19:47:04 +0000 (14:47 -0500)]
pimd: Use correct flag to add an oif

When we are creating the igmp ifchannel we were creating
it with both a P and a I flag.  This was causing
it to not be cleaned up properly when the interface
was shut down.  Subsuquently when the interface
came back up we would attempt to add it back in
but it would fail.

Ticket: CM-14586
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Handle assignment of vif index better
Donald Sharp [Sat, 21 Jan 2017 09:54:10 +0000 (04:54 -0500)]
pimd: Handle assignment of vif index better

PIM was handling vif creation deletion poorly
for interface down and up events.  Fix this
issue by keeping track of which vif index'es
we have issued and allow the wholes to be
filled in.

Ticket: CM-14556
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fixup tracking of where we got OIF's from.
Donald Sharp [Thu, 19 Jan 2017 17:09:26 +0000 (12:09 -0500)]
pimd: Fixup tracking of where we got OIF's from.

This commit does these three things:

1) Add code to 'show ip pim state' to show where OIF's got their
decision to include that interface

2) Add code in pim_mroute_[add|del] to display what we think we are
adding to the kernel

3) Add code to properly track where we got the incoming request from and
to appropriately not remove a OIL if we have state still

Ticket: CM-14034
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agolib: Moved zapi message types to zclient.h
Donald Sharp [Mon, 12 Dec 2016 17:47:48 +0000 (12:47 -0500)]
lib: Moved zapi message types to zclient.h

Move the data structure used to have knowledge about
the zapi message types to zclient.h where it belongs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Refactor Error codes to proper place
Donald Sharp [Mon, 12 Dec 2016 17:16:21 +0000 (12:16 -0500)]
zebra: Refactor Error codes to proper place

These error codes have ended up only being used
for socket type interfaces to the kernel(*bsd),
yet we were exposing the #defines to the entirety
of the project.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Cleanup dead code and unused return value
Donald Sharp [Mon, 12 Dec 2016 17:11:27 +0000 (12:11 -0500)]
zebra: Cleanup dead code and unused return value

We had a large block of #if 0 code.  Since it's
been that way for like 8 months now, lets go ahead
and just remove it.

Additionally the rib_delete function was returning
a return code that was summarily ignored.  Let's
clean up the expectation of returning anything.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Consolidate nexthop_active_ipv4 and _ipv6
Donald Sharp [Mon, 12 Dec 2016 14:20:49 +0000 (09:20 -0500)]
zebra: Consolidate nexthop_active_ipv4 and _ipv6

Both of these functions are identical.  Consolidate
to 1 function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, zebra: Pass distance as part of the ZEBRA_NEXTHOP_UPDATE
Donald Sharp [Fri, 9 Dec 2016 17:05:29 +0000 (12:05 -0500)]
bgpd, zebra: Pass distance as part of the ZEBRA_NEXTHOP_UPDATE

When zebra calls routing protocols back with either
ZEBRA_NEXTHOP_UPDATE or ZEBRA_IMPORT_CHECK_UPDATE
pass the distance value too.

This is to set us up for nht for pim as that it needs
the distance sometimes too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Move qpim_zclient_update -> zclient
Donald Sharp [Fri, 9 Dec 2016 16:08:45 +0000 (11:08 -0500)]
pimd: Move qpim_zclient_update -> zclient

Rename the qpim_zclient_update variable to zclient.
This is to follow the naming conventions in the rest
of the code.

Additionally move the struct zclient * pointer into pim_zebra.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Start abstraction of zclient data structure for pim_zebra.c
Donald Sharp [Fri, 9 Dec 2016 16:05:08 +0000 (11:05 -0500)]
pimd: Start abstraction of zclient data structure for pim_zebra.c

Start the abstraction of the zclient data structure out from a
global variable for the entire program to a global variable
to the pim_zebra.c file.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agodoc: add dst-src static route commands
David Lamparter [Fri, 28 Nov 2014 07:39:46 +0000 (08:39 +0100)]
doc: add dst-src static route commands

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: support static srcdest routes
Christian Franke [Thu, 24 Nov 2016 16:10:19 +0000 (17:10 +0100)]
zebra: support static srcdest routes

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agozebra: add srcdest support to rib
Christian Franke [Mon, 5 Dec 2016 19:05:30 +0000 (20:05 +0100)]
zebra: add srcdest support to rib

Add srcdest support to the zebra rib and to the kernel
and redistribution interfaces.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agolib: add cleanup hook to route table
Christian Franke [Wed, 18 Jan 2017 22:46:43 +0000 (23:46 +0100)]
lib: add cleanup hook to route table

7 years agotests: add a test for the srcdest_table structure
Christian Franke [Sun, 1 Jun 2014 16:26:30 +0000 (18:26 +0200)]
tests: add a test for the srcdest_table structure

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
[DL: v2: fix missing slash in tests/Makefile.am]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: add second-level route_table for srcdest
David Lamparter [Thu, 24 Apr 2014 17:29:07 +0000 (19:29 +0200)]
lib: add second-level route_table for srcdest

IPv6 srcdest routes need to be keyed by both destination and source
prefix.  Since the lookup order is destination first, the simplest thing
to do here is to add a second route_table to destination entries, which
then contain source entries.  Sadly, the result is somewhat confusing
since a route_node might now be either a source node or a destination
node.

There are helper functions to get source and destination prefix from a
given route node (which can be either a destination or a source route).

The following bits have been added by Christian Franke
<chris@opensourcerouting.org>:
- make srcdest routing table reusable by moving it into lib
- make the srcdest routing table structure more opaque
- implement a srcdest routing table iterator
- fix a refcounting issue in src_node_lookup
- match route_node_lookup behavior with srcdest_rnode_lookup
- add accessor for the route_node table and table_info
- add string formatter srcdest_rnode2str

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
[v3: adapted for cmaster-next as of 2016-12-05]

7 years agopimd: Remove Double call of routemap_teriminate
Donald Sharp [Mon, 30 Jan 2017 12:47:21 +0000 (07:47 -0500)]
pimd: Remove Double call of routemap_teriminate

"He's dead, Jim"

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: add route_node_lookup_maynull
David Lamparter [Tue, 6 May 2014 17:21:51 +0000 (19:21 +0200)]
lib: add route_node_lookup_maynull

The sourcedest code needs to get the route_node even if its info pointer
is NULL (which occurs when there are srcdest routes, but no general
destination route.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: read and ignore srcdest routes on ZAPI
Christian Franke [Wed, 8 Jul 2015 17:48:51 +0000 (19:48 +0200)]
*: read and ignore srcdest routes on ZAPI

Since zebra might be sending srcdest routes down to the various daemons,
they need to understand the presence of the field at the very least.
Sadly, that's also the best we can do at this point since none of the
protocols has support for handling srcdest routes.  The only consistent
thing to do is to ignore them throughout.

If an administrator wants to have the srcdest route as non-srcdest in a
protocol, setting a non-srcdest static route (possibly blackhole) is
probably the best way to go.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: send ZAPI IPv6 source prefix
David Lamparter [Thu, 24 Apr 2014 15:30:26 +0000 (17:30 +0200)]
lib: send ZAPI IPv6 source prefix

This introduces ZAPI_MESSAGE_SRCPFX, and if set adds a source prefix
field to ZAPI IPv6 route messages sent from daemons to zebra.  The
function calls all have a new prefix_ipv6 * argument specifying the
source, or NULL.  All daemons currently supply NULL.

Zebra support for processing the field was added in the previous patch,
however, zebra does not do anything useful with the value yet.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: receive ZAPI IPv6 source prefix
David Lamparter [Thu, 24 Apr 2014 15:41:43 +0000 (17:41 +0200)]
zebra: receive ZAPI IPv6 source prefix

Check and read the IPv6 source prefix on ZAPI messages, and pass it down
to the RIB functions (which do nothing with it yet.)  Since the RIB
functions now all have a new extra argument, this also updates the
kernel route read functions to supply NULL.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospf6d: Fix Ambiguous Commands
Donald Sharp [Mon, 30 Jan 2017 00:08:03 +0000 (19:08 -0500)]
ospf6d: Fix Ambiguous Commands

Ospf6d has ambiguous commands due to duplicated
functions that belong in lib/routemap.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix help strings to have newlines
Donald Sharp [Mon, 30 Jan 2017 00:07:04 +0000 (19:07 -0500)]
zebra: Fix help strings to have newlines

Fix a couple help strings in zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agodebian: Update version to 2.1
Donald Sharp [Mon, 30 Jan 2017 00:06:11 +0000 (19:06 -0500)]
debian: Update version to 2.1

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agocumulus: Fix incorrect inclusion for some platforms.
Donald Sharp [Mon, 30 Jan 2017 00:04:58 +0000 (19:04 -0500)]
cumulus: Fix incorrect inclusion for some platforms.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #130 from LabNConsulting/working/master/patch/rev-2.1
Donald Sharp [Sun, 29 Jan 2017 23:47:24 +0000 (18:47 -0500)]
Merge pull request #130 from LabNConsulting/working/master/patch/rev-2.1

master: bump rev and change issues pointer

7 years agoMerge pull request #129 from donaldsharp/redistribute
Lou Berger [Fri, 27 Jan 2017 22:36:20 +0000 (17:36 -0500)]
Merge pull request #129 from donaldsharp/redistribute

Fix some more issues with cli