]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 years agobgpd: change str2mac call api 149/head
Philippe Guibert [Thu, 9 Feb 2017 07:44:13 +0000 (08:44 +0100)]
bgpd: change str2mac call api

With the changed API, some adaptations are done in rfapi code.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agolib: simplify str2mac and use struct ethaddr structure
Philippe Guibert [Thu, 9 Feb 2017 07:42:32 +0000 (08:42 +0100)]
lib: simplify str2mac and use struct ethaddr structure

This commit simplified the string to mac conversion, since it uses
sscanf, instead of depicting each incoming character one by one, and
doing self analysis. Also,this commit changes the internal usage of the
mac address representation in mac handling function.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agobgpd: reflect mac handling change of apis to bgpd
Philippe Guibert [Fri, 3 Feb 2017 08:10:08 +0000 (09:10 +0100)]
bgpd: reflect mac handling change of apis to bgpd

As the prefix call function for mac handling has prefix_ prepended
before, the change must be propagated to all locations where those
functions are called.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agolib: append prefix_ for mac handling functions
Philippe Guibert [Fri, 3 Feb 2017 07:28:57 +0000 (08:28 +0100)]
lib: append prefix_ for mac handling functions

This commit is changing the function naming for mac handling functions.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agolib: handle str2mac case where buffer is allocated by the function
Philippe Guibert [Wed, 1 Feb 2017 18:05:19 +0000 (19:05 +0100)]
lib: handle str2mac case where buffer is allocated by the function

The case where no buffer is passed to the str2mac function is handled.
In that case, a buffer is allocated. Then the check against the buffer
length is not done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agobgpd: use mac2str() function utility to display mac address
Philippe Guibert [Wed, 1 Feb 2017 17:41:38 +0000 (18:41 +0100)]
bgpd: use mac2str() function utility to display mac address

VNC uses the prefix API to handle mac string.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 years agolib: add string to macaddress and reverse function
Philippe Guibert [Wed, 1 Feb 2017 17:26:34 +0000 (18:26 +0100)]
lib: add string to macaddress and reverse function

As mac-address structure is to be used as a prefix field, two new
functions permit handling mac address in order to convert it. either
from string to internal value, or the reverse operation.
Internal representation of a mac address is a 6 byte char value standing
for the 6 byte value the mac address has.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 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

8 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

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

8 years agotests/testcli: cleanup at exit 139/head
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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agozebra: Do not force NEXTHOP_TYPE to XXX_IFINDEX 133/head
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>
8 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>
8 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>
8 years agolib, bgpd: fix miscellaneous route-map commands 137/head
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>
8 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

8 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)

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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>
8 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]

8 years agopimd: Remove Double call of routemap_teriminate 132/head
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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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

8 years agomaster: point to https://github.com/freerangerouting/frr/issues 130/head
Lou Berger [Fri, 27 Jan 2017 21:24:03 +0000 (16:24 -0500)]
master: point to https://github.com/freerangerouting/frr/issues

8 years agomaster: bump rev to 2.1-dev
Lou Berger [Fri, 27 Jan 2017 21:21:57 +0000 (16:21 -0500)]
master: bump rev to 2.1-dev

8 years agobgpd: Fix crash in a vpn command 129/head
Donald Sharp [Fri, 27 Jan 2017 21:17:08 +0000 (16:17 -0500)]
bgpd: Fix crash in a vpn command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/master' into redistribute
Donald Sharp [Fri, 27 Jan 2017 21:11:55 +0000 (16:11 -0500)]
Merge remote-tracking branch 'origin/master' into redistribute

8 years agoMerge pull request #122 from donaldsharp/moreafisafi
Lou Berger [Fri, 27 Jan 2017 21:10:54 +0000 (16:10 -0500)]
Merge pull request #122 from donaldsharp/moreafisafi

More CLI fixes/cleanup

8 years agobgpd: Fix help strings
Donald Sharp [Fri, 27 Jan 2017 20:51:41 +0000 (15:51 -0500)]
bgpd: Fix help strings

Fix the missing help strings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: Fix redistribute issue
Donald Sharp [Fri, 27 Jan 2017 20:33:00 +0000 (15:33 -0500)]
*: Fix redistribute issue

Somewhere in the past we switched from
using the auto-generated redistribute statements
to a non-generated version.  This caused us to
loose new protocols to redistribute as they are
added.  Put it back.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix Auto generation of redistribution strings
Donald Sharp [Fri, 27 Jan 2017 20:36:09 +0000 (15:36 -0500)]
lib: Fix Auto generation of redistribution strings

When we changed the parser we forgot to update this
script to modify the '(...)' to '<...>'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agotests: Fix conversion between iana_t and afi_t
Donald Sharp [Fri, 27 Jan 2017 20:31:47 +0000 (15:31 -0500)]
tests: Fix conversion between iana_t and afi_t

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'master' into moreafisafi 122/head
Donald Sharp [Fri, 27 Jan 2017 19:58:19 +0000 (14:58 -0500)]
Merge branch 'master' into moreafisafi

8 years agobgp: Fix merge mistake
Lou Berger [Fri, 27 Jan 2017 19:30:27 +0000 (14:30 -0500)]
bgp: Fix merge mistake

I choose the wrong merge direction.  Fixed.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: Update README 128/head
Donald Sharp [Fri, 27 Jan 2017 17:53:40 +0000 (12:53 -0500)]
*: Update README

1) Modify that PIM-SM/MSDP is now included
2) Add pointers to where people can talk to us

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Fixup some cli help strings that were missing
Donald Sharp [Fri, 27 Jan 2017 17:45:34 +0000 (12:45 -0500)]
bgpd: Fixup some cli help strings that were missing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/pr/113' into pr/111
Donald Sharp [Fri, 27 Jan 2017 17:39:06 +0000 (12:39 -0500)]
Merge remote-tracking branch 'origin/pr/113' into pr/111

8 years agoMerge remote-tracking branch 'origin/master' into pr/111
Donald Sharp [Fri, 27 Jan 2017 16:44:42 +0000 (11:44 -0500)]
Merge remote-tracking branch 'origin/master' into pr/111

8 years agoMerge pull request #107 from donaldsharp/bgpafisafi
Lou Berger [Fri, 27 Jan 2017 15:57:46 +0000 (10:57 -0500)]
Merge pull request #107 from donaldsharp/bgpafisafi

Bgp afi safi fixes

8 years agobgpd: Fix assert condition error. 107/head
Donald Sharp [Fri, 27 Jan 2017 14:49:30 +0000 (09:49 -0500)]
bgpd: Fix assert condition error.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agotests: use lib memory allocation 127/head
Lou Berger [Fri, 27 Jan 2017 14:16:43 +0000 (09:16 -0500)]
tests: use lib memory allocation

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgp: Add Asserts and remove dead code
Donald Sharp [Fri, 27 Jan 2017 14:07:44 +0000 (09:07 -0500)]
bgp: Add Asserts and remove dead code

Add asserts to how I expect bgp_vty_find_and_parse_afi_safi
to be used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Make usage of idx consistent
Donald Sharp [Fri, 27 Jan 2017 13:12:53 +0000 (08:12 -0500)]
bgpd: Make usage of idx consistent

Convert the idx to &idx to make our api more consistent

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: assert on duplicate free (count)
Lou Berger [Fri, 27 Jan 2017 12:46:25 +0000 (07:46 -0500)]
lib: assert on duplicate free (count)

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd: Fix possible crash and some minor CR issues
Donald Sharp [Fri, 27 Jan 2017 09:57:44 +0000 (04:57 -0500)]
bgpd: Fix possible crash and some minor CR issues

This fix addresses these things:

1) Clean up documentation as requested
2) Fix a wrong search for "exact-match"
3) Fix possible crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge pull request #123 from opensourcerouting/graph-fixes
Donald Sharp [Thu, 26 Jan 2017 15:45:22 +0000 (10:45 -0500)]
Merge pull request #123 from opensourcerouting/graph-fixes

lib/graph.c fixes

8 years agoMerge remote-tracking branch 'origin/master' into bgpafisafi
Donald Sharp [Thu, 26 Jan 2017 15:38:07 +0000 (10:38 -0500)]
Merge remote-tracking branch 'origin/master' into bgpafisafi

8 years agoMerge branch 'master' into working/master/patch-set/4-misc-fixes 113/head
Lou Berger [Thu, 26 Jan 2017 14:59:03 +0000 (09:59 -0500)]
Merge branch 'master' into working/master/patch-set/4-misc-fixes

Merged pull request with master

Conflicts:
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/rfapi/rfapi_vty.c

8 years agopimd: More pim cli fixup
Donald Sharp [Thu, 26 Jan 2017 14:10:54 +0000 (09:10 -0500)]
pimd: More pim cli fixup

Found some additional issues with the pim
cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Fix crash when entering 'address-family ipv4'
Donald Sharp [Thu, 26 Jan 2017 14:09:38 +0000 (09:09 -0500)]
bgpd: Fix crash when entering 'address-family ipv4'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: graph: fix vector_remove() 123/head
David Lamparter [Thu, 26 Jan 2017 04:59:50 +0000 (05:59 +0100)]
lib: graph: fix vector_remove()

vector_remove would corrupt the data in the following sequence:
1. assume vector v = [a, b], active = 2
2. vector_unset(v, 0) => v = [NULL, b], active = 2
3. vector_remove(v, 1)

vector_remove calls vector_unset(v, 1), vector_unset notices index #0 is
also NULL and thus sets active to 0.

The equality test in vector_remove() now fails, leading it to decrement
v->active *again*, leading to an underflow that will likely crash the
daemon (and might even be exploitable).

This call sequence does not happen in existing code since vector_unset()
is not used on graph from/to lists.  Nonetheless this is a buried land
mine in the code at best.

Rewrite the function - while we're at it, there's no reason to move the
entire array around, just fill the hole with the last element.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agolib: graph: speed up node deletion
David Lamparter [Thu, 26 Jan 2017 05:56:48 +0000 (06:56 +0100)]
lib: graph: speed up node deletion

We don't need to copy the from/to arrays, we can just iterate backwards.

NB: this makes graph_remove_edge delete only one edge (which is more
consistent with graph_add_edge allowing parallel edges).

Iterating graph->nodes backwards also makes graph_delete_graph faster
since that also iterates backwards.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: graph: fix deletions
David Lamparter [Wed, 25 Jan 2017 03:13:14 +0000 (04:13 +0100)]
lib: graph: fix deletions

Iterating over an array while deleting items needs to consider
interactions between the iteration position and deletion.  The previous
code completely ignored that problem, leading to memleaks (graph_delete
skipping half of the nodes) and dangling pointers (if parallel edges
exist in graph_remove_edge).

Iterating backwards is safe and reduces "move to fill hole" overhead in
deletion.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agobgpd: Allow some new cli to have correct number of help strings
Donald Sharp [Thu, 26 Jan 2017 03:08:35 +0000 (22:08 -0500)]
bgpd: Allow some new cli to have correct number of help strings

The 'add vrf NAME prefix....' command was missing a \n
and the 'no label' command was missing a help string for no.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agovtysh: Add 'vrf-policy NAME' and 'exit-vrf-policy' to ignore list.
Donald Sharp [Thu, 26 Jan 2017 03:04:49 +0000 (22:04 -0500)]
vtysh: Add 'vrf-policy NAME' and 'exit-vrf-policy' to ignore list.

vtysh needs to ignore these two commands or we'll get duplicate warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Fix '[no] labels LABELLIST...' command
Donald Sharp [Thu, 26 Jan 2017 02:55:25 +0000 (21:55 -0500)]
bgpd: Fix '[no] labels LABELLIST...' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd, vtysh: Allow bgp and vtysh to work together again
Donald Sharp [Thu, 26 Jan 2017 02:51:28 +0000 (21:51 -0500)]
bgpd, vtysh: Allow bgp and vtysh to work together again

Harmony is restored to the world as bgp and vtysh
can now, again, stay in sync with each other.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Fix error in "no set large-comm-list"
Donald Sharp [Thu, 26 Jan 2017 02:38:58 +0000 (21:38 -0500)]
bgpd: Fix error in "no set large-comm-list"

The cli for "no set large-comm-list..."
is wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge branch 'frr/pull/118'
David Lamparter [Thu, 26 Jan 2017 02:15:33 +0000 (03:15 +0100)]
Merge branch 'frr/pull/118'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge pull request #101 from LabNConsulting/working/master/patch-set/3-vrf
Donald Sharp [Wed, 25 Jan 2017 23:26:15 +0000 (18:26 -0500)]
Merge pull request #101 from LabNConsulting/working/master/patch-set/3-vrf

Master version of basic vrf commands & some other missed fixes

8 years agoMerge branch 'frr/pull/92' (BGP Large Community support)
David Lamparter [Wed, 25 Jan 2017 22:04:29 +0000 (23:04 +0100)]
Merge branch 'frr/pull/92' (BGP Large Community support)

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: lcommunity: fix minor issues
David Lamparter [Wed, 25 Jan 2017 21:33:29 +0000 (22:33 +0100)]
bgpd: lcommunity: fix minor issues

- route_set_lcommunity would do nothing (and leak memory) if attr->extra
  wasn't up yet
- an if() arch in bgp_show_table() was duplicated (with no effect)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: lcommunity: fix whitespace & copyright
David Lamparter [Wed, 25 Jan 2017 21:29:31 +0000 (22:29 +0100)]
bgpd: lcommunity: fix whitespace & copyright

(to match surrounding code)
"git diff -w" should be almost empty.

Copyright edited to say FRR, this is not GNU Zebra :)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: Remove redundant warning message
Donald Sharp [Wed, 25 Jan 2017 14:43:11 +0000 (09:43 -0500)]
bgpd: Remove redundant warning message

When bgp_vty_find_and_parse_afi_safi_vrf detects
a invalidly named vrf, it warns the user.  There
is no need for the calling function to warn
again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Add some documentation for bgp_vty_find_and_parse_afi_safi_vrf
Donald Sharp [Wed, 25 Jan 2017 14:37:13 +0000 (09:37 -0500)]
bgpd: Add some documentation for bgp_vty_find_and_parse_afi_safi_vrf

The use of this function was causing some confusion.  As
such let's add some documentation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Cleanup some missing help strings. 118/head
Donald Sharp [Wed, 25 Jan 2017 14:13:46 +0000 (09:13 -0500)]
pimd: Cleanup some missing help strings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge pull request #116 from bingen/bugfix/zclient_missing_break
Donald Sharp [Wed, 25 Jan 2017 13:56:33 +0000 (08:56 -0500)]
Merge pull request #116 from bingen/bugfix/zclient_missing_break

lib: Fix missing break in zlcient switch

8 years agolib: Fix missing break in zlcient switch 116/head
ßingen [Wed, 25 Jan 2017 13:33:01 +0000 (14:33 +0100)]
lib: Fix missing break in zlcient switch

8 years agobgpd: Add ability to clean lcommunity hash 92/head
Donald Sharp [Wed, 25 Jan 2017 13:26:21 +0000 (08:26 -0500)]
bgpd: Add ability to clean lcommunity hash

Ensure that we don't leak any memory on shutdown.
Since the bgp_lcommunity.c file mirrors bgp_ecommunity.c
Add the same code for shutdown that ecommunity has.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>