]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agolib: CID 1399296: Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
Martin Winter [Fri, 3 Feb 2017 11:37:48 +0000 (18:37 +0700)]
lib: CID 1399296: Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)

Needs to be a comparison, not assignment

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agozebra: Fix CID 1399335 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)
Martin Winter [Fri, 3 Feb 2017 11:30:59 +0000 (18:30 +0700)]
zebra: Fix CID 1399335 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)

Needs to be size of correct structure (prefix instead of prefix_ipv4)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agovtysh: Fix Coverity Warning CID 1399479 (#1 of 1): Destination buffer too small ...
Martin Winter [Fri, 10 Feb 2017 09:51:57 +0000 (16:51 +0700)]
vtysh: Fix Coverity Warning CID 1399479 (#1 of 1): Destination buffer too small (BUFFER_SIZE)

Coverity: buffer_size: You might overrun the 108 byte destination string addr.sun_path by writing the maximum 4095 bytes from path.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated (BUFFER...
Martin Winter [Fri, 3 Feb 2017 11:09:36 +0000 (18:09 +0700)]
ospfd: Fix Coverity Warning CID 1399480 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)

Coverity: buffer_size_warning: Calling strncpy with a maximum size argument of 100 bytes on destination array pid_file of size 100 bytes might leave the destination string unterminated.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge pull request #191 from opensourcerouting/ospfclient-incl
Donald Sharp [Thu, 9 Feb 2017 17:12:17 +0000 (12:12 -0500)]
Merge pull request #191 from opensourcerouting/ospfclient-incl

[stable] ospfclient: #include sources

7 years agoospfclient: #include sources
David Lamparter [Thu, 9 Feb 2017 11:59:44 +0000 (12:59 +0100)]
ospfclient: #include sources

Pulling in source files from another directory breaks automake's
distclean target, and there seems to be no good fix for this...
(particularly since we need -fPIC build for a DSO here, while ospfd
compiles for an executable...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #190 from opensourcerouting/config-write-sync-stable
Donald Sharp [Thu, 9 Feb 2017 14:26:58 +0000 (09:26 -0500)]
Merge pull request #190 from opensourcerouting/config-write-sync-stable

[stable] lib: use fsync() for config writes, plug fd leak

7 years agolib: use fsync() for config writes, plug fd leak
David Lamparter [Wed, 8 Feb 2017 15:14:10 +0000 (16:14 +0100)]
lib: use fsync() for config writes, plug fd leak

sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #179 from donaldsharp/more_quagga_fixups
Lou Berger [Wed, 8 Feb 2017 01:46:44 +0000 (20:46 -0500)]
Merge pull request #179 from donaldsharp/more_quagga_fixups

*: Found some instances of Quagga.conf

7 years ago*: Found some instances of Quagga.conf
Donald Sharp [Tue, 7 Feb 2017 18:44:09 +0000 (13:44 -0500)]
*: Found some instances of Quagga.conf

Cleanup Quagga.conf -> Frr.conf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #176 from opensourcerouting/mtype-underflow-backtrace
Donald Sharp [Tue, 7 Feb 2017 18:04:27 +0000 (13:04 -0500)]
Merge pull request #176 from opensourcerouting/mtype-underflow-backtrace

lib: print backtrace on MTYPE count underflow

7 years agoMerge pull request #178 from opensourcerouting/ospf_lib_private
Donald Sharp [Tue, 7 Feb 2017 18:04:13 +0000 (13:04 -0500)]
Merge pull request #178 from opensourcerouting/ospf_lib_private

make libfrrospf private

7 years agoMerge pull request #173 from LabNConsulting/working/2.0/patch-set/issue-172
David Lamparter [Tue, 7 Feb 2017 16:27:44 +0000 (17:27 +0100)]
Merge pull request #173 from LabNConsulting/working/2.0/patch-set/issue-172

2.0: Fix encap attribute on wire, protect against broken object.

7 years agoospfd: make libfrrospf a private non-dynamic lib
David Lamparter [Tue, 24 Jan 2017 22:26:20 +0000 (23:26 +0100)]
ospfd: make libfrrospf a private non-dynamic lib

There's no point in installing libospf anymore, now that
libfrrospfclient doesn't link it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: isolate ospfapiclient lib from ospf lib
David Lamparter [Tue, 24 Jan 2017 20:35:08 +0000 (21:35 +0100)]
ospfd: isolate ospfapiclient lib from ospf lib

The OSPF API-client library doesn't really use anything from libospf
except some small dumping tools.  Isolate these into a separate file
and detangle the ospfapiclient library.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #161 from donaldsharp/stableMcLibrary
David Lamparter [Tue, 7 Feb 2017 16:17:12 +0000 (17:17 +0100)]
Merge pull request #161 from donaldsharp/stableMcLibrary

Stable mc library

7 years agobgpd: Allow views to 'pretend' resolve nexthops
Donald Sharp [Wed, 1 Feb 2017 15:31:40 +0000 (10:31 -0500)]
bgpd: Allow views to 'pretend' resolve nexthops

Views are supposed to be independent tables that have no connection to
routing tables.  Since View's are 'independent' there is no way to do
'real' nexthop resolution since connected routes and interfaces are
associated with a particular table (or really vrf).  So when we have a
bgp instance assume that nexthops specified are actually valid, since we
are propagating what our neighbors are telling us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
[cherry-picked from master 6fa1ab2eecb39b35256739f7083196d6f556f639]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'frr/pull/157' ("Fixinator")
David Lamparter [Tue, 7 Feb 2017 15:38:03 +0000 (16:38 +0100)]
Merge branch 'frr/pull/157' ("Fixinator")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: print backtrace on MTYPE count underflow
David Lamparter [Tue, 7 Feb 2017 15:23:38 +0000 (16:23 +0100)]
lib: print backtrace on MTYPE count underflow

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #171 from donaldsharp/double_free
Renato Westphal [Tue, 7 Feb 2017 13:48:15 +0000 (11:48 -0200)]
Merge pull request #171 from donaldsharp/double_free

lib: Don't use malloc!

7 years agobgpd rfapi: advertise encap attribute when TT is valid and not MPLS.
Lou Berger [Tue, 7 Feb 2017 02:29:43 +0000 (21:29 -0500)]
bgpd rfapi: advertise encap attribute when TT is valid and not MPLS.
     Ensure tunnel type set based on rx'ed
     Ignore bad/mpls encap types.

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agolib: Fixup CR comment
Donald Sharp [Tue, 7 Feb 2017 09:54:40 +0000 (04:54 -0500)]
lib: Fixup CR comment

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Don't use malloc!
Donald Sharp [Mon, 6 Feb 2017 17:52:28 +0000 (12:52 -0500)]
lib: Don't use malloc!

thread.c was using malloc.  This was found by the
assert added to memory.c.

Fixes issues #170

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #167 from qlyoung/vtysh-subs-stable
Martin Winter [Fri, 3 Feb 2017 20:11:18 +0000 (12:11 -0800)]
Merge pull request #167 from qlyoung/vtysh-subs-stable

vtysh: Quagga.conf -> Frr.conf

7 years agovtysh: Quagga.conf -> Frr.conf
Quentin Young [Wed, 1 Feb 2017 22:01:17 +0000 (22:01 +0000)]
vtysh: Quagga.conf -> Frr.conf

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #158 from LabNConsulting/working/2.0/patch-set/rfapi+vty
Donald Sharp [Fri, 3 Feb 2017 16:54:52 +0000 (11:54 -0500)]
Merge pull request #158 from LabNConsulting/working/2.0/patch-set/rfapi+vty

2.0: Fix a couple of merge related and rfapi/show vpn issues

7 years agoRevert "bgpd: Put back original behavior for some show bgp commands"
Donald Sharp [Fri, 3 Feb 2017 15:33:14 +0000 (10:33 -0500)]
Revert "bgpd: Put back original behavior for some show bgp commands"

This reverts commit 713de0685fc0ef882c97a6cb4bd149620f4dbdf4.

During Discussions with Lou, it was decided that his code
changes would handle this part, and my code changes would
fix up vtysh and bgp to be in sync again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, vtysh: Fix vtysh able to handle some safi modes for bgp
Donald Sharp [Fri, 3 Feb 2017 15:29:53 +0000 (10:29 -0500)]
bgpd, vtysh: Fix vtysh able to handle some safi modes for bgp

This adds the ability for vtysh to handle v4 and v6
safi modes besides unicast and multicast.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
7 years agobgp: remove HAVE_IPV6 from file (again!)
Lou Berger [Fri, 3 Feb 2017 15:16:01 +0000 (10:16 -0500)]
bgp: remove HAVE_IPV6 from file (again!)

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: add missing json strings
Lou Berger [Fri, 3 Feb 2017 15:04:19 +0000 (10:04 -0500)]
bgpd: add missing json strings

Signed-off-by: Lou Berger <lberger@labn.net>
7 years ago*: Convert libospf -> libfrrospf
Donald Sharp [Fri, 3 Feb 2017 13:43:55 +0000 (08:43 -0500)]
*: Convert libospf -> libfrrospf

Convert the libospfapiclient -> libfrrospfapiclient
and libospf -> libfrrospf to prevent namespace
collision with Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Convert libfpm -> libfrrfpm
Donald Sharp [Fri, 3 Feb 2017 13:43:09 +0000 (08:43 -0500)]
*: Convert libfpm -> libfrrfpm

Convert the libfpm to libfrrfpm to prevent namespace
collision with Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoospf6d: Fix compile warnings
Donald Sharp [Fri, 3 Feb 2017 13:26:33 +0000 (08:26 -0500)]
ospf6d: Fix compile warnings

These compile issues were found by running ./buildtest.sh
on a fedora 25 box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoospfd: Fix compile warnings
Donald Sharp [Fri, 3 Feb 2017 13:22:15 +0000 (08:22 -0500)]
ospfd: Fix compile warnings

These compile issues were found w/ gcc and running
./buildtest.sh on a fedora 25 box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoripd: Fix compile warning
Donald Sharp [Fri, 3 Feb 2017 13:20:14 +0000 (08:20 -0500)]
ripd: Fix compile warning

This issue was found compiling with ./buildtest.sh
on fedora 25

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Convert libzebra -> libfrr
Donald Sharp [Fri, 3 Feb 2017 12:59:04 +0000 (07:59 -0500)]
*: Convert libzebra -> libfrr

The library libzebra that is installed with FRR will
conflict with Quagga.  So let's rename it to libfrr.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: get rid of 'unknown' in show safi (broken in earlier merge)
Lou Berger [Fri, 3 Feb 2017 02:35:24 +0000 (21:35 -0500)]
bgpd: get rid of 'unknown' in show safi (broken in earlier merge)

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: cleanup/restore show ip|ipv6 bgp and show bgp ipv4 summary related commands
Lou Berger [Fri, 3 Feb 2017 02:33:55 +0000 (21:33 -0500)]
bgpd: cleanup/restore show ip|ipv6 bgp and show bgp ipv4 summary related commands

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500
Lou Berger [Fri, 3 Feb 2017 00:50:36 +0000 (19:50 -0500)]
bgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: Put back original behavior for some show bgp commands
Donald Sharp [Thu, 2 Feb 2017 18:56:56 +0000 (13:56 -0500)]
bgpd: Put back original behavior for some show bgp commands

The behavior of some show commands was switched from
showing the unicast data to all safi data.  This
is a change in behavior and needs to be put
back for 2.0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Allow vtysh to work for address-family
Donald Sharp [Thu, 2 Feb 2017 18:54:47 +0000 (13:54 -0500)]
bgpd: Allow vtysh to work for address-family

extract.pl.in requires the lines that are ignored
to be consisten with what is in the *.c file
that we are ignoring from, else we get ambiguous
commands.

This allows vtysh to enter address-family sub mode
in bgp again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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 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 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 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 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 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 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/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 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 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 #121 from opensourcerouting/snapcraft-packaging
Donald Sharp [Fri, 27 Jan 2017 20:38:43 +0000 (15:38 -0500)]
Merge pull request #121 from opensourcerouting/snapcraft-packaging

snapcraft: Add snapcraft build and documentation files

7 years agosnapcraft: Add snapcraft build and definition files
Martin Winter [Wed, 25 Jan 2017 21:23:43 +0000 (04:23 +0700)]
snapcraft: Add snapcraft build and definition files

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge pull request #120 from opensourcerouting/snapcraft-base-v3
Russ White [Wed, 25 Jan 2017 20:04:49 +0000 (15:04 -0500)]
Merge pull request #120 from opensourcerouting/snapcraft-base-v3

Snapcraft base changes

7 years agolib: Don't change uid/gid if we are already the correct uid/gid
Martin Winter [Fri, 20 Jan 2017 19:48:45 +0000 (02:48 +0700)]
lib: Don't change uid/gid if we are already the correct uid/gid

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agovtysh: Add --config_dir option to override compiled in location for vtysh.conf and...
Martin Winter [Sun, 11 Dec 2016 03:06:54 +0000 (19:06 -0800)]
vtysh: Add --config_dir option to override compiled in location for vtysh.conf and Quagga.conf

Only allow the override if vtysh is not run with setuid()

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoldpd: add ctl_socket cli option to override the compiled-in location for the control...
Renato Westphal [Tue, 24 Jan 2017 17:31:40 +0000 (00:31 +0700)]
ldpd: add ctl_socket cli option to override the compiled-in location for the control socket

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agovtysh: Use HOME environment variable to get homedir and only fallback to passed entry...
Martin Winter [Fri, 20 Jan 2017 19:48:06 +0000 (02:48 +0700)]
vtysh: Use HOME environment variable to get homedir and only fallback to passed entry if no HOME is defined

Snap packages have a local HOME defined inside the SNAP container, but don't get access to passwd entry.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agovtysh: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Wed, 25 Jan 2017 17:43:58 +0000 (00:43 +0700)]
vtysh: Add vty_socket cli option to override the compiled-in location for the VTY daemon sockets

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoripngd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 17:25:28 +0000 (00:25 +0700)]
ripngd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoripd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 17:22:59 +0000 (00:22 +0700)]
ripd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoldpd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 17:19:25 +0000 (00:19 +0700)]
ldpd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agopimd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:58:52 +0000 (22:58 +0700)]
pimd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoospfd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:57:15 +0000 (22:57 +0700)]
ospfd: Add vty_socket cli option to override the compiled-in location for the VTY Socket and add instance number for multi-instance ospf

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoospf6d: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:55:26 +0000 (22:55 +0700)]
ospf6d: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoisisd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:52:49 +0000 (22:52 +0700)]
isisd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agobgpd: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:45:50 +0000 (22:45 +0700)]
bgpd: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agozebra: Add vty_socket cli option to override the compiled-in location for the VTY...
Martin Winter [Tue, 24 Jan 2017 15:44:28 +0000 (22:44 +0700)]
zebra: Add vty_socket cli option to override the compiled-in location for the VTY Socket

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agolib: Add set_socket_path() to sockopt.c to override the path element of a (vty) socke...
Martin Winter [Tue, 24 Jan 2017 15:42:11 +0000 (22:42 +0700)]
lib: Add set_socket_path() to sockopt.c to override the path element of a (vty) socket (but keep filename)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agopimd: Add missing 'socket' getopt cmdline option
Martin Winter [Fri, 20 Jan 2017 19:29:25 +0000 (02:29 +0700)]
pimd: Add missing 'socket' getopt cmdline option

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge pull request #112 from LabNConsulting/working/2.0/patch-set/rr1
Donald Sharp [Wed, 25 Jan 2017 01:54:32 +0000 (20:54 -0500)]
Merge pull request #112 from LabNConsulting/working/2.0/patch-set/rr1

2.0, Issue #91 FIx VPN/ENCAP safi handoff to rfapi

7 years agobgpd rfapi: Shift rfapi receive hooks for vpn and encap safis into
G. Paul Ziemba [Mon, 16 Jan 2017 19:09:12 +0000 (11:09 -0800)]
bgpd rfapi: Shift rfapi receive hooks for vpn and encap safis into
     bgp_update/bgp_withdraw (Issue #91)

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agoMerge pull request #106 from donaldsharp/sbuild
David Lamparter [Tue, 24 Jan 2017 16:24:07 +0000 (17:24 +0100)]
Merge pull request #106 from donaldsharp/sbuild

debian: Fix changelog so sbuild will work

7 years agodebian: Fix changelog so sbuild will work
Donald Sharp [Sat, 21 Jan 2017 12:51:22 +0000 (07:51 -0500)]
debian: Fix changelog so sbuild will work

Fix the changelog so a sbuild issued for the
creation of a .deb works.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #99 from opensourcerouting/rename-fixes
Donald Sharp [Fri, 20 Jan 2017 16:22:33 +0000 (11:22 -0500)]
Merge pull request #99 from opensourcerouting/rename-fixes

Rename Quagga->FRR Fixes