]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years ago*: fix trivial build errors on *BSD
Renato Westphal [Thu, 4 Aug 2016 13:07:33 +0000 (10:07 -0300)]
*: fix trivial build errors on *BSD

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: create an abstraction layer for netlink_neigh_update()
Renato Westphal [Thu, 4 Aug 2016 13:07:32 +0000 (10:07 -0300)]
zebra: create an abstraction layer for netlink_neigh_update()

We shouldn't have platform-agnostic code (e.g. zebra/interface.c)
calling platform-specific functions (e.g. netlink_neigh_update).

This commit introduces the kernel_neigh_update() function, which then
has to be implemented by all supported platforms. Currently only Linux
implements this function, which is only used by the RTADV code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: replace __u32 with standard uint32_t
Renato Westphal [Thu, 4 Aug 2016 13:07:31 +0000 (10:07 -0300)]
zebra: replace __u32 with standard uint32_t

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agopimd: add a workaround for *BSD
Renato Westphal [Thu, 4 Aug 2016 13:07:30 +0000 (10:07 -0300)]
pimd: add a workaround for *BSD

VIFF_USE_IFINDEX is not available on BSDs and other UNIX systems. In
order to build pimd on these platforms, use 'vifc_lcl_addr' instead of
'vifc_lcl_ifindex' to specify the interfaces we want to enable forwarding
of multicast traffic. In the case of unnumbered interfaces, print an
error and return.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agobgpd: fix wrong use of IN6_IS_ADDR_LINKLOCAL
Renato Westphal [Thu, 4 Aug 2016 13:07:29 +0000 (10:07 -0300)]
bgpd: fix wrong use of IN6_IS_ADDR_LINKLOCAL

The IN6_IS_ADDR_LINKLOCAL macro expects to receive a pointer to an
in6_addr structure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agobgpd: use utsname.domainname only when available
Renato Westphal [Thu, 4 Aug 2016 13:07:28 +0000 (10:07 -0300)]
bgpd: use utsname.domainname only when available

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: update strlcpy to OpenBSD v1.13
Renato Westphal [Thu, 4 Aug 2016 13:07:27 +0000 (10:07 -0300)]
lib: update strlcpy to OpenBSD v1.13

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: fix setting of IPv4 multicast sockopts on OpenBSD
Renato Westphal [Thu, 4 Aug 2016 13:07:26 +0000 (10:07 -0300)]
lib: fix setting of IPv4 multicast sockopts on OpenBSD

OpenBSD doesn't support the "ifindex hack" derived from RFC 1724 which
allows an ifindex to be encoded in the imr_interface field (in_addr)
of the ip_mreq structure. OpenBSD also doesn't support the RFC3678
Protocol-Independent socket API extensions, which allows an interface
to be specified by its ifindex. With that said, in OpenBSD we still need
to specify an interface by its IP address. This patch adds an exception
in the multicast sockopt functions to handle this case.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoospf6d: fix sendmsg on OpenBSD
Renato Westphal [Thu, 4 Aug 2016 13:07:25 +0000 (10:07 -0300)]
ospf6d: fix sendmsg on OpenBSD

When sending ancillary data on OpenBSD, we need to tell the compiler
that the ancillary data buffer should be aligned on the stack to the
minimum alignment of the first ancillary data object that will be sent.

Additionally, HAVE_SIN6_SCOPE_ID is not defined anywhere, check for
HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: fix build on OpenBSD >= 5.9
Renato Westphal [Thu, 4 Aug 2016 13:07:24 +0000 (10:07 -0300)]
zebra: fix build on OpenBSD >= 5.9

RTF_XRESOLVE was removed from the OpenBSD tree recently.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Mon, 8 Aug 2016 00:56:35 +0000 (20:56 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

8 years agobgpd: Fix for CM-11982 bgp failed to redistribute connected in vrf table
Sid Khot [Fri, 5 Aug 2016 23:49:39 +0000 (16:49 -0700)]
bgpd: Fix for CM-11982 bgp failed to redistribute connected in vrf table

Made fix to update the redistribute vrf bitmap when vrf goes down and comes up.

Ticket: CM-11982
Reviewed By: CCR-5032
Testing Done: bgp-min passed, manual

8 years ago'debug ospf' print a garbage character
Daniel Walton [Fri, 5 Aug 2016 21:47:42 +0000 (21:47 +0000)]
'debug ospf' print a garbage character

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: sidkhot@cumulusnetworks.com
Ticket: CM-12271

8 years agoFix changelog to add maintainer info, build fails without it
John Berezovik [Thu, 4 Aug 2016 16:08:37 +0000 (09:08 -0700)]
Fix changelog to add maintainer info, build fails without it

8 years agolib: Add newline terminators to pim docstring
Quentin Young [Wed, 3 Aug 2016 19:30:06 +0000 (19:30 +0000)]
lib: Add newline terminators to pim docstring

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoquagga: Set version strings appropriately
Donald Sharp [Tue, 2 Aug 2016 08:54:45 +0000 (04:54 -0400)]
quagga: Set version strings appropriately

Set the version strings to be correct for the upcoming
3.1 release of Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Arm build breakage with MAX_INT macro issues
Donald Sharp [Wed, 3 Aug 2016 14:26:31 +0000 (10:26 -0400)]
lib: Arm build breakage with MAX_INT macro issues

The VTY_GET_INTEGER_RANGE macro is failing on arm
with a warning->error issue where we are passing in
a unsigned MAXINT to this macro and it is complaining
that the comparison of (TMPL) > MAXINT is always going
to be false because of data structure size.

I've changed the tmp variable to a unsigned long long
which alleviates this issue.

Ticket: CM-12187
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agobgpd: Add command to prefer global ipv6 address
Don Slice [Wed, 3 Aug 2016 13:49:09 +0000 (06:49 -0700)]
bgpd: Add command to prefer global ipv6 address

There are cases where customers desire the ability to override the
default behavior of installing ipv6 prefixes with a link-local next-hop
if both a link-local and global ipv6 next-op is present in the bgp table.
This fix provides this ability and will allow the global to be used as the
next-hop.  This also retains the ability to manually set the ipv6 next-hop
global value as before, and if so, this manual entry will be used for the
next-hop.

Ticket: CM-11480
Signed-off-by: Don Slice
Reviewed By: CCR-4983
Testing Done: Manual testing results attached to the ticket. bgp-min and
bgp-smoke will be completed before committing.

8 years agobgpd: Add the no form of some dump bgp commands
Donald Sharp [Mon, 1 Aug 2016 17:38:05 +0000 (13:38 -0400)]
bgpd: Add the no form of some dump bgp commands

Ticket: CM-9432
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:

8 years agoconfigure: Auto pick-up the correct json env
Donald Sharp [Sat, 4 Jun 2016 23:55:22 +0000 (19:55 -0400)]
configure: Auto pick-up the correct json env

Fix the code to allow Quagga to automatically
compile with the correct json library.

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

8 years agoBGP displays "keepalive" instead of "keepalives" for debugs
Daniel Walton [Mon, 1 Aug 2016 12:15:28 +0000 (12:15 +0000)]
BGP displays "keepalive" instead of "keepalives" for debugs

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

8 years agovtysh: Do not run extract.pl over protocols that are not configured
Donald Sharp [Thu, 28 Jul 2016 18:28:22 +0000 (14:28 -0400)]
vtysh: Do not run extract.pl over protocols that are not configured

Dynamically figure out the list of .c files that we need to scan
based upon whether or not the daemon is --enabled via configure.

Ticket: CM-12081
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agolib: 'show commandtree' is not a CLI command
Donald Sharp [Thu, 28 Jul 2016 18:02:52 +0000 (14:02 -0400)]
lib: 'show commandtree' is not a CLI command

The 'show commandtree' command was added to the CONFIG_NODE.

We have a basic assumption that CONFIG_NODE commands actually
change state.  'show commandtree' doesn't meet this requirement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoisisd: drop unused per-type metric values
David Lamparter [Thu, 28 Jul 2016 15:23:32 +0000 (17:23 +0200)]
isisd: drop unused per-type metric values

Expense, Error and Delay metrics never quite made it into the real
world.  Either way isisd does nothing useful with them, so let's drop
them from the code.  If someone wants to implement them, this patch can
still be reverted.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: area (L1), domain (L2) passwords
Christian Franke [Thu, 28 Jul 2016 15:23:31 +0000 (17:23 +0200)]
isisd: API: area (L1), domain (L2) passwords

Last isisd CLI cleanup for now.  This also folds L1 & L2 configs into
common functions, reducing CLI function bloat by a bit.

(This patch contains changes authored by both Christian Franke and David
Lamparter.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: timers (LSP, SPF)
Christian Franke [Thu, 28 Jul 2016 15:23:30 +0000 (17:23 +0200)]
isisd: API: timers (LSP, SPF)

See previous commits...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: LSP-MTU & area level
Christian Franke [Thu, 28 Jul 2016 15:23:29 +0000 (17:23 +0200)]
isisd: API: LSP-MTU & area level

Yet more CLI functions in isis_vty.c using more nice setters.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: timers (IIH, CSNP, PSNP)
David Lamparter [Thu, 28 Jul 2016 15:23:28 +0000 (17:23 +0200)]
isisd: API: timers (IIH, CSNP, PSNP)

No setters needed since change of fields doesn't require any
specific action to make it apply.  Just move the CLI defs to isis_vty.c.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: circuit password
Christian Franke [Thu, 28 Jul 2016 15:23:27 +0000 (17:23 +0200)]
isisd: API: circuit password

This cleans up circuit password configuration a little bit.
(Restructured several times by both Christian Franke and David
Lamparter.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: basic area config
Christian Franke [Thu, 28 Jul 2016 15:23:26 +0000 (17:23 +0200)]
isisd: API: basic area config

Move out basic area configuration (metric type, overload and attachment
bits, dynamic hostname extension enable) into isis_vty.c.

[v2: moved stuff back here that accidentally was in the previous patch]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoisisd: API: basic circuit config
David Lamparter [Fri, 29 Jul 2016 14:19:40 +0000 (16:19 +0200)]
isisd: API: basic circuit config

Create isis_vty.c and start moving off CLI functions into that.  These
then call newly-added "nice" API wrappers.

Patch contains significant work authored by Christian Franke.

[v2: removed stuff that crept in from the next patch]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: get rid of "MTYPE 0"
David Lamparter [Thu, 28 Jul 2016 15:23:49 +0000 (17:23 +0200)]
*: get rid of "MTYPE 0"

A few places are using 0 in place of the MTYPE_* argument.  The
following rewrite of the alloc tracking won't deal with that, so let's
use MTYPE_TMP instead.

Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v2: fix XFREE(0, foo) calls too]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: relegate pim_igmp_join.c into a header file
David Lamparter [Thu, 28 Jul 2016 15:23:48 +0000 (17:23 +0200)]
pimd: relegate pim_igmp_join.c into a header file

pim_igmp_join.c only exists to make some portability hacks available to
test_igmpv3_join.  The function only has 1 call site in each pimd and
the test tool, so it's nicely served as a simple static function in a
header file.

This removes a MTYPE related compiler/linker issue from referencing
lib/if.h in a binary that doesn't link libzebra, as test_igmpv3_join is
now fully independent of lib/.

(Fix by Christian Franke: remove stray leftover ifindex_t)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: add 3-byte stream functions
David Lamparter [Thu, 28 Jul 2016 15:23:47 +0000 (17:23 +0200)]
lib: add 3-byte stream functions

This will be used for BGP MPLS labels.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: linklist: clean up insert-before/after dups
David Lamparter [Thu, 28 Jul 2016 15:23:46 +0000 (17:23 +0200)]
lib: linklist: clean up insert-before/after dups

- list_add_node_next was in fact unused
- list_add_node_prev performs a subset of listnode_add_before and
  its only use in isisd replaced with that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: snmp: add a load of "static" specifiers
David Lamparter [Thu, 28 Jul 2016 15:23:45 +0000 (17:23 +0200)]
*: snmp: add a load of "static" specifiers

Make it easier to see which bits in *_snmp.c are actually referenced
from non-SNMP parts of the code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: fix include for SNMP
David Lamparter [Thu, 28 Jul 2016 15:23:44 +0000 (17:23 +0200)]
zebra: fix include for SNMP

no idea where this disappeared.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: AgentX: use threads instead of eventloop hack
David Lamparter [Thu, 28 Jul 2016 15:23:43 +0000 (17:23 +0200)]
lib: AgentX: use threads instead of eventloop hack

AgentX fd/timeout handling is rather hackishly monkeyed into thread.c.
Replace with code that uses plain thread_* functions.

NB: Net-SNMP's API rivals Quagga's in terms of age and absence of
documentation.  netsnmp_check_outstanding_agent_requests() in particular
seems to be unused and is therefore untested.

The most useful documentation on this is actually the blog post Vincent
Bernat wrote when he originally integrated this into lldpd and Quagga:
https://vincent.bernat.im/en/blog/2012-snmp-event-loop.html

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: add thread_add_timer_tv (struct timeval)
David Lamparter [Thu, 28 Jul 2016 15:23:42 +0000 (17:23 +0200)]
lib: add thread_add_timer_tv (struct timeval)

Another zoo extension, this adds a timer scheduling function that takes
a struct timeval argument (which is actually what the wrappers boil down
to, yet it's not exposed...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: linklist: add listnode_add_before()
David Lamparter [Thu, 28 Jul 2016 15:23:41 +0000 (17:23 +0200)]
lib: linklist: add listnode_add_before()

This utility function, to join the zoo that the Quagga linked-list
implementation has accumulated, does an insert-before while returning
the newly allocated node.

It is similar to:
- listnode_add_after(), but
  - complementary direction
  - returns allocated node
- list_add_node_prev(), but
  - supports before == NULL
  - returns allocated node

In general, the entire linked-list implementation is in bad shape, and
while it needs a cleanup / rewrite / replacement, this would both cause
significant conflicts and block other cleanups...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: remove a whole bunch of unused time stuff
David Lamparter [Thu, 28 Jul 2016 15:23:40 +0000 (17:23 +0200)]
lib: remove a whole bunch of unused time stuff

QUAGGA_CLK_REALTIME and QUAGGA_CLK_REALTIME_STABILISED aren't used
anywhere in the code.  Remove.  The enum is kept to avoid having to
change the calls everywhere.

Same applies to the workaround code for systems that don't have a
monotonic clock.  None of the systems Quagga works on fall into that
category;  Linux, BSD and Solaris all do clock_gettime, for OSX we have
mach_absolute_time() - that covers everything.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: use quagga_monotime() for zserv and rnh
Christian Franke [Thu, 28 Jul 2016 15:23:39 +0000 (17:23 +0200)]
zebra: use quagga_monotime() for zserv and rnh

quagga_time() will disappear with the next commit, this is the last
remaining user of it.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: use random() to pick initial DD seq#
David Lamparter [Thu, 28 Jul 2016 15:23:38 +0000 (17:23 +0200)]
ospfd: use random() to pick initial DD seq#

While the idea for this came the other way around - removing
quagga_time() - using random() is actually a better idea here.  It's
seeded by time to begin with, but if ospfd restarts several times in a
short timespan it won't run straight into the same sequence number.

(Should also update the random seed to include microseconds so restarts
within a second use a different seq#)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: ditch unused time fields
David Lamparter [Thu, 28 Jul 2016 15:23:37 +0000 (17:23 +0200)]
ospfd: ditch unused time fields

The ctime/mtime fields in ospf_route and start_time field in ospf_master
are written but never read, thus entirely useless.  Remove them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: monotonic clock for lsa_refresher_started
David Lamparter [Thu, 28 Jul 2016 15:23:36 +0000 (17:23 +0200)]
ospfd: monotonic clock for lsa_refresher_started

ospf->lsa_refresher_started is only used in relative timing to itself;
replace with monotonic clock which is appropriate for this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: ditch unused bgp_node_*() functions
David Lamparter [Thu, 28 Jul 2016 15:23:35 +0000 (17:23 +0200)]
bgpd: ditch unused bgp_node_*() functions

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: divorce router-id logic from CLI & zebra
David Lamparter [Thu, 28 Jul 2016 15:23:34 +0000 (17:23 +0200)]
bgpd: divorce router-id logic from CLI & zebra

Logic for determining the router-id was spread out over bgp_zebra.c and
bgp_vty.c.  Move to bgpd/bgpd.c and have these two call more properly
encapsulated functions.

Significant work by Christian Franke <chris@opensourcerouting.org>.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: minor header/API clean up
David Lamparter [Thu, 28 Jul 2016 15:23:33 +0000 (17:23 +0200)]
bgpd: minor header/API clean up

Adds "const" on:
- peer_update_source_addr_set()
- peer_description_set()
Adds parameter names on:
- bgp_timers_set()
  (really confusing, this one, with 2 unexplained args of same type)
Adds new setter:
- peer_afc_set(), calling peer_activate/peer_deactivate.
  (intended for API consumers, matches peer->afc)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: Pass correct bgp-name for clear command
Don Slice [Thu, 28 Jul 2016 21:35:48 +0000 (14:35 -0700)]
bgpd: Pass correct bgp-name for clear command

Found that original fix for CM-10113 had a significant flaw, that
by deriving the bgp instance from the vty->index, if a clear ip bgp
command was entered from a vty index other then bgp, a crash occurred.
This fix passes the bgp->name to the clear functions so the correct
instance can be derived.  Tested manually in both the CM-10113 case
as well as the problem discovered while testing CM-11480.

Ticket: CM-10113
Signed-off-by: Don Slice
Reviewed-by:

8 years agopimd: supply VIFF_USE_IFINDEX definition
David Lamparter [Wed, 27 Jul 2016 18:02:54 +0000 (20:02 +0200)]
pimd: supply VIFF_USE_IFINDEX definition

This fixes compilation if the system libc doesn't have VIFF_USE_IFINDEX.
It'll still break runtime if the kernel is older than 2.6.32.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agotests: update testcli reference output
David Lamparter [Wed, 27 Jul 2016 17:39:46 +0000 (19:39 +0200)]
tests: update testcli reference output

an extra comment line got added somewhere inbetween.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoRevert "lib: Rewrite ipv4 address and prefix validator"
David Lamparter [Wed, 27 Jul 2016 17:39:45 +0000 (19:39 +0200)]
Revert "lib: Rewrite ipv4 address and prefix validator"

This reverts commit d4dc41b6a23d5156b0d9068006a1eeb3ba32e301.

The rewritten parser fails to recognise "1.2." as partial input for an
IPv4 address, which causes "make check" to fail.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: fixup snmp support
David Lamparter [Wed, 27 Jul 2016 17:39:44 +0000 (19:39 +0200)]
*: fixup snmp support

- HAVE_POLL is overloaded by net-snmp
- missing includes
- ospf6_snmp converted to vrf_iflist()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: Fix for CM-11908 BGP: 'Address-family encap' cli issues
Sid Khot [Wed, 27 Jul 2016 01:20:37 +0000 (18:20 -0700)]
bgpd: Fix for CM-11908 BGP: 'Address-family encap' cli issues

Made fix to handle the "Ambigious command" for address-family vpvn6 and vpnv6 unicast.
Rest of the bug analysis is below:
1. Issues with address-family encap/address-family encapv6/address-family vpnv6/address-family vpnv6 unicast need to be added to the ignore list in the test file tests.l3.quagga_cfg_cli_crawler_test. Sid to fix the "Ambiguous command" for vpnv6 as part of fix for this bug.
2. Neighbor <ipaddr/interface> disable-connected-check/ttl. Options should not be listed for interface. Anitha to file bugs for these. And also remove these commands from the test file tests.l3.quagga_cfg_cli_crawler_test.

Ticket:  CM-11908
Reviewed By: CCR-4999
Testing Done: Manual, Ran the tests.l3.quagga_cfg_cli_crawler_test

<DETAILED DESCRIPTION (REPLACE)>

8 years agolib: Free memory correctly when braces used in parser
Don Slice [Tue, 26 Jul 2016 13:44:39 +0000 (06:44 -0700)]
lib: Free memory correctly when braces used in parser

When braces (optional parameters) are used in the quagga parser, there
was a small leak on every iteration.  Since this construct is primarily
used in the configuation process rather than show commands, it was not
readily apparent.  With the addition of the "show ip bgp {json}" form of
the commands, each time one was run, memory was leaked.

Ticket: CM-11435
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing, bgp-min and bgp-smoke successful

8 years agobgpd: Fix attribute handling upon redistribution metric change
vivek [Tue, 26 Jul 2016 17:45:51 +0000 (10:45 -0700)]
bgpd: Fix attribute handling upon redistribution metric change

When the metric for a redistributed route is changed through configuration,
the path attribute for the route/routes need to be "re-created" as the hash
entry would change. In the absence of this, the entry would have the correct
values but when a hash lookup is done at a later time (e.g., when trying to
free the entry), it would fail. This patch addresses the "re-creation"

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11168
Reviewed By: CCR-4990
Testing Done: Manual, bgp-smoke

8 years agodebian: Remove pimd build object from packaging
Donald Sharp [Tue, 26 Jul 2016 17:32:52 +0000 (13:32 -0400)]
debian: Remove pimd build object from packaging

We've disabled pimd, remove the build object
from our packaging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
8 years agobgpd: Fix for vtysh -m does not mark "end" of router bgp
Sid Khot [Tue, 26 Jul 2016 17:23:46 +0000 (10:23 -0700)]
bgpd: Fix for  vtysh -m does not mark "end" of router bgp

There was an exit added at the end of the BGP commands after we pulled the code from upstream. This was causing the reload scripts to fail. Removed this exit.

Ticket: CM-11464 CM-11924
Reviewed By: CCR-4995
Testing Done: Manual

<DETAILED DESCRIPTION (REPLACE)>

8 years agodebian: Disable pimd in cmaster-next
Donald Sharp [Tue, 26 Jul 2016 16:42:28 +0000 (12:42 -0400)]
debian: Disable pimd in cmaster-next

Turn off the building of pimd in cmaster-next.

Ticket: CM-12015
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: Modify 'banner motd file <X>'
Donald Sharp [Fri, 22 Jul 2016 23:50:51 +0000 (19:50 -0400)]
lib: Modify 'banner motd file <X>'

Modify the banner motd file X command to do these things
differently:

1)  Only allow the file <X> to be in SYSCONFDIR
2)  Only allow the user to use a file that exists.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
8 years agoMake vtysh-integrated-config truly the default and fix quagga reload for this.
Dinesh G Dutt [Wed, 20 Jul 2016 15:24:47 +0000 (08:24 -0700)]
Make vtysh-integrated-config truly the default and fix quagga reload for this.

Ticket: CM-11910
Reviewed By: sharpd, routing-dev slack
Testing Done: Test with nothing in vtysh.conf, add no, remove it etc.

Even though we force integrated config to be the default, we do this by adding
a line to our default vtysh.conf which has integrated config enabled. When we
stopped printing integrated-config as part of wr mem or show running-config, we
broke quagga reload because it was explicitly looking for integrated config.
Furthermore, merely fixing quagga reload wouldn't work because subsequent saves
would result in config being saved to individual files since vtysh.conf no
longer forced the file to be integrated.

This patch fixes both issues. Makes integrated config the default in the code,
rather than via a shipped default file, and fixes quagga reload to look for
the "no integrated-vtysh-config" to deny attempting a reload.

8 years agobgpd: Print the correct table in "show ip bgp x.x.x.x"
Don Slice [Wed, 20 Jul 2016 12:02:04 +0000 (08:02 -0400)]
bgpd: Print the correct table in "show ip bgp x.x.x.x"

Prior to this change, bgp always identified the routing table used as
the default in the output of "show ip bgp x.x.x.x".  This fix changes
the behavior to use the correct table name.

Ticket: CM-10239
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
vivek [Wed, 20 Jul 2016 02:36:04 +0000 (19:36 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agoospfd: Ensure correct handling of router-id change
vivek [Wed, 20 Jul 2016 02:17:38 +0000 (19:17 -0700)]
ospfd: Ensure correct handling of router-id change

Upon router-id change, one object that needs to be updated is the "nbr_self"
structure that is created to contain information about the local router and
is used during DR election, among other things. In the past, the code used to
just change the router-id field of this structure. This is actually not
sufficient - the neighbor has to be deleted and re-added into the tree. This
was fixed upstream and the fix is now available in our tree, but those changes
don't work well with prior Cumulus changes to defer updating the router-id
in the OSPF instance until other cleanup has happened.

Fixed code to update the "nbr_self" structure correctly while continuing to
defer the router_id update in the OSPF structure.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11861
Reviewed By: CCR-4980
Testing Done: Manual, failed test

8 years agoDon't print empty sections as they clutter the output of show-running
Dinesh G Dutt [Mon, 18 Jul 2016 06:08:05 +0000 (23:08 -0700)]
Don't print empty sections as they clutter the output of show-running

Ticket: CM-11808
Reviewed By: CCR-4971
Testing Done: Usual stuff including doing show running with multiple daemons

Interface and VRF are both sections of the config that could possibly be
empty. This unnecessarily clutters the output of show running. This patch
fixes that by not displaying empty sections of interface, and vrf.
Routemaps have a genuine empty stanza and so we cannot add routemap to this
list. Unfortunately this means a "show running-config ospfd" may have empty
route-maps if the route-maps all correspond to BGP, for example. This
is not a concern for the entire "show running-config".

The trick in fixing this is on the vtysh side rather than on the client side.
The reason for this is that its quite tricky given the number of options to
ensure that a daemon never printed a section header unless there was something
to print. On the vtysh side, however, its easy to check if a section is
empty and not print it.

8 years agoDeprecate link-detect and don't display it in show running-config
Dinesh G Dutt [Mon, 18 Jul 2016 06:12:12 +0000 (23:12 -0700)]
Deprecate link-detect and don't display it in show running-config

Ticket: CM-11808
Reviewed By: CCR-4972
Testing Done: Usual stuff

link-detect is on by default, and has been so since the first release
of Cumulus Linux. So, in the light of not displaying defaults, don't
display link-detect if enabled, only if disabled.

8 years agoDon't display integrated-vtysh-config as its the default in CL.
Dinesh G Dutt [Mon, 18 Jul 2016 06:38:51 +0000 (23:38 -0700)]
Don't display integrated-vtysh-config as its the default in CL.

Ticket: CM-11832
Reviewed By:
Testing Done: Testing that its not displayed if enabled & only if disabled

In the spirit of not displaying the defaults, we shouldn't display
"service integrated-vtysh-config" as its the default. It also tends to
clutter the output with stuff the user doesn't know or care about. This
patch removes displaying that and only prints it when the option is
disabled.

8 years agobgpd: Use the correct bgp instance for cli commands issuing clear
Don Slice [Mon, 18 Jul 2016 14:32:46 +0000 (10:32 -0400)]
bgpd: Use the correct bgp instance for cli commands issuing clear

Some bgp commands end with doing a bgp_clear_vty, which invalidly
made the assumption that the clear should always be done for the default
instance.  This fix derives the correct instance from the vty-index if
one is supplied, and uses the default instance if it is not.

Ticket: CM-10113
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
8 years agoSimplify BGP unnumbered configuration by eliminating the unessential.
Dinesh G Dutt [Wed, 13 Jul 2016 22:31:27 +0000 (15:31 -0700)]
Simplify BGP unnumbered configuration by eliminating the unessential.

To make BGP configuration as simple as possible, assume the capability
extended-nexthop to be default for interface neighbors. Also allow the
ability to specify remote-as on the same line as neighbor interface to
make BGP unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

(cherry picked from commit 347914a0a785993200cb04ae3cbf8ff9a9104d60)

8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Fri, 15 Jul 2016 20:40:01 +0000 (16:40 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

P unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
Don Slice [Tue, 19 Jul 2016 17:37:08 +0000 (10:37 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agoSimplify BGP unnumbered configuration by eliminating the unessential.
Dinesh G Dutt [Wed, 13 Jul 2016 22:31:27 +0000 (15:31 -0700)]
Simplify BGP unnumbered configuration by eliminating the unessential.

To make BGP configuration as simple as possible, assume the capability
extended-nexthop to be default for interface neighbors. Also allow the
ability to specify remote-as on the same line as neighbor interface to
make BGP unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

8 years agozebra: Eliminate use of imported arp entries as next-hops for other routes
Don Slice [Fri, 15 Jul 2016 13:33:48 +0000 (06:33 -0700)]
zebra: Eliminate use of imported arp entries as next-hops for other routes

Ticket: CM-8228
Signed-off-by: Donald Slice
Reviewed By:
Testing Done: Manual testing succesful. bgp-min and ospf-smoke successful. redistribute-neighbor-smoke
has the same failures as the base image.

Problem was due to considering imported /32 arp entries as elible next-hops for other routes
(in this case a static route.)  This confuses the rib since this next-hop is considered both
recursive and  onlink.  Disallowed the use of this imported arp entry in next-hop determination.

8 years agobgpd: Make ASN optional for `no router bgp`
Quentin Young [Thu, 14 Jul 2016 13:04:47 +0000 (13:04 +0000)]
bgpd: Make ASN optional for `no router bgp`

When there is one BGP router instance, `no router bgp` may be used to
deconfigure it without specifying its ASN

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Wed, 13 Jul 2016 00:24:00 +0000 (20:24 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

8 years agopimd: Refactor some encode/decode functions
Donald Sharp [Wed, 13 Jul 2016 00:13:32 +0000 (20:13 -0400)]
pimd: Refactor some encode/decode functions

Some encode/decode functions are needed in multiple places.
Start the refactoring to be able to use them in a more generic
manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Some Initial Groundwork for register stop
Donald Sharp [Wed, 13 Jul 2016 00:11:15 +0000 (20:11 -0400)]
pimd: Some Initial Groundwork for register stop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow (S,G) pimreg route to time out
Donald Sharp [Wed, 13 Jul 2016 18:22:42 +0000 (14:22 -0400)]
pimd: Allow (S,G) pimreg route to time out

When a kernel upcall happens for nocache we create
a (S,G) route to be installed into the kernel.
This code modification starts the ability to
time out the mroute if we stop receiving mcast
packets.

Ticket: CM-11793
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Remove some extraneous hexdump's
Donald Sharp [Wed, 13 Jul 2016 16:46:09 +0000 (12:46 -0400)]
pimd: Remove some extraneous hexdump's

On every kernel upcall we are dumping the packet.  Stop that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add generic function to retrieve mroute stats
Donald Sharp [Wed, 13 Jul 2016 15:41:41 +0000 (11:41 -0400)]
pimd: Add generic function to retrieve mroute stats

Add a generic function to retrieve mroute statistics
from the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Disallow ebgp-multihop on swpX peers
Quentin Young [Tue, 12 Jul 2016 21:13:24 +0000 (21:13 +0000)]
bgpd: Disallow ebgp-multihop on swpX peers

Disallow setting ebgp-multihop on peers directly
connected via an interface.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoquagga-reload.py needs a --stdout option
Daniel Walton [Tue, 12 Jul 2016 20:10:05 +0000 (20:10 +0000)]
quagga-reload.py needs a --stdout option

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

8 years agopimd: multicast route not removed from kernel when the if goes down
Donald Sharp [Tue, 12 Jul 2016 19:25:11 +0000 (15:25 -0400)]
pimd: multicast route not removed from kernel when the if goes down

When a multicast route's rpf changes( for whatever reason ) (*,G)
routes were never updating properly.  This is because we were
attempting to fing the path to the *, instead of the RP.
Modify the code to check if we are attempting to find a
* route and use the RP instead.

Ticket: CM-11736
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Track if the mroute is installed or not
Donald Sharp [Tue, 12 Jul 2016 19:22:10 +0000 (15:22 -0400)]
pimd: Track if the mroute is installed or not

Track whether or not if a mroute has been installed
or not.  If not don't display information about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Refactor pim_mroute_add and _del
Donald Sharp [Tue, 12 Jul 2016 19:16:53 +0000 (15:16 -0400)]
pimd: Refactor pim_mroute_add and _del

The struct mfcctl should not be passed around.  Pass around
the channel oil instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Refactor 'struct static_route' to use channel_oil
Donald Sharp [Tue, 12 Jul 2016 19:09:25 +0000 (15:09 -0400)]
pimd: Refactor 'struct static_route' to use channel_oil

The 'struct static_route' data structure duplicated a
decent bit of what is the in the struct channel_oil.
Refactor.  This will set us up for further cleanup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Stale IGMP groups left behind
Donald Sharp [Tue, 12 Jul 2016 15:31:45 +0000 (11:31 -0400)]
pimd: Stale IGMP groups left behind

When a toin IGMPv3 join is received, the code
was always auto creating the igmp group associated
with the received packet.  The RFC clearly states
though that if a INCLUDE is received for a group
with 0 sources and we have received nothing the
igmpv3 packet should be ignored.

Ticket: CM-11260
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start naive implementation of anysource_forward_stop
Donald Sharp [Mon, 11 Jul 2016 20:22:14 +0000 (16:22 -0400)]
pimd: Start naive implementation of anysource_forward_stop

Naive implementation of igmp_anysource_foward_stop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: IGMPv3 leave not deleting group entry
Donald Sharp [Mon, 11 Jul 2016 19:54:37 +0000 (15:54 -0400)]
pimd: IGMPv3 leave not deleting group entry

After sending a IGMPv3 exclude report for a multicast address
with 0 sources, send an include report for the same group and also 0
sources.  This should cause IGMP to GS query and age/delete
the entry.

This fix addresses this issue.

Ticket: CM-11685
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Rewrite ipv4 address and prefix validator
Quentin Young [Mon, 27 Jun 2016 14:51:17 +0000 (14:51 +0000)]
lib: Rewrite ipv4 address and prefix validator

Simplify ipv4 prefix and address matcher / validator to use standard
Linux networking functions instead of a state machine.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agolib: Disallow % in IPv6 addresses and prefixes
Quentin Young [Mon, 27 Jun 2016 14:42:17 +0000 (14:42 +0000)]
lib: Disallow % in IPv6 addresses and prefixes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agolib: Rewrite ipv6 prefix matcher
Quentin Young [Mon, 27 Jun 2016 13:14:18 +0000 (13:14 +0000)]
lib: Rewrite ipv6 prefix matcher

Simplify ipv6 prefix matcher / validator to use standard Linux
networking functions instead of a state machine.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agoall: add default log file if none are defined
Don Slice [Mon, 11 Jul 2016 19:57:24 +0000 (12:57 -0700)]
all: add default log file if none are defined

Added a default log file named /var/log/quagga/Quagga.log to every daemon
to capture log entries if no log file is defined.  This also allows the
capture of logged information prior to reading each daemon's config file.
If a log file is defined manually, it will override this default file name.

Ticket: CM-10987
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing

8 years agopimd: static joins no longer worked
Donald Sharp [Mon, 11 Jul 2016 16:57:28 +0000 (12:57 -0400)]
pimd: static joins no longer worked

Static joins were killed by a previous commit, which
has been backed out.  I've recoded the igmp join
code to ignore 224.0.0.0/24 from ourselves a bit
differently now.

Ticket: CM-11751
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoRevert "pimd: Prevent igmp packet loopback."
Donald Sharp [Mon, 11 Jul 2016 16:28:36 +0000 (12:28 -0400)]
Revert "pimd: Prevent igmp packet loopback."

This reverts commit 5bbcd1f0fd82e0e982700dbc12dd959629e91b58.

This commit badly breaks local 'ip igmp join XXX YYY' commands.

Revert this and fix the issue a slightly different way

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoDon't print 'neighbor activate' if its default for IPv4 unicast AFI/SAFI
Dinesh G Dutt [Wed, 6 Jul 2016 13:50:23 +0000 (06:50 -0700)]
Don't print 'neighbor activate' if its default for IPv4 unicast AFI/SAFI

Ticket: CM-11460
Reviewed By: CCR-4927
Testing Done:

Quagga's default "show running" model is to only print the non-default config.
Historically, IPv4 unicast has always had a default 'activate' model unless
its been configured otherwise. In 3.0, we introduced a print of the 'activate'
statement for IPv4 unicast independent of whether it was the default or not.
This causes quagga reload to break as the user doesn't configure 'activate' for
IPv4 unicast, and so any config changes will also not have it. However 'show
running' will display it, causing quagga reload to think that the AFI/SAFI has
been deactivated and bounce the sessions incorrectly.

This patch reverts to the original quagga behavior/model of not printing the
'activate' line for IPv4 unicast if its the default.

8 years agobgpd: BGP should accept "router-id IFNAME"
Sid Khot [Sat, 2 Jul 2016 00:25:30 +0000 (17:25 -0700)]
bgpd: BGP should accept "router-id IFNAME"
ospfd: OSPF should accept "router-id IFNAME"

Added commands in BGP and OSPF where user can specify interface for router-id.

Ticket: CM-5040
Reviewed By: CCR-4908
Testing Done: Manual

8 years agobgpd: "neigbor <interface> ttl-security hops" should reject a hops value greater...
Sid Khot [Sat, 2 Jul 2016 00:06:43 +0000 (17:06 -0700)]
bgpd: "neigbor <interface> ttl-security hops" should reject a hops value greater than 1
      "neighbor <interface> disable-connected-check" should not be allowed by the parser

Made changes to not allow hops greater than 1 and disable-connected check for neighbor <interface>

Ticket: CM-5536 CM-5537
Reviewed By: CCR-4865
Testing Done: Manual

8 years agopimd: Set default logfile to Quagga.log
Donald Sharp [Thu, 30 Jun 2016 04:43:30 +0000 (00:43 -0400)]
pimd: Set default logfile to Quagga.log

Until such time a log file line is generated,
default to using /var/log/quagga/Quagga.log

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim: Show Iif for 'show ip pim upstream' command
Donald Sharp [Wed, 29 Jun 2016 19:49:57 +0000 (15:49 -0400)]
pim: Show Iif for 'show ip pim upstream' command

Modify the 'show ip pim upstream' command to
show the expected incoming interface for
the source.

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