]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agolib: fix thread scheduling weirdness
Quentin Young [Tue, 29 Aug 2017 18:58:43 +0000 (14:58 -0400)]
lib: fix thread scheduling weirdness

Restores 3.0 behavior in terms of thread scheduling & prioritization.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #998 from mkanjari/dev-master
David Lamparter [Tue, 29 Aug 2017 18:03:48 +0000 (20:03 +0200)]
Merge pull request #998 from mkanjari/dev-master

Dev master

7 years agoMerge pull request #1072 from opensourcerouting/isisd-fix-confusion-purge
Donald Sharp [Tue, 29 Aug 2017 17:07:45 +0000 (13:07 -0400)]
Merge pull request #1072 from opensourcerouting/isisd-fix-confusion-purge

isisd: keep original TLVs when purging in response to confusion

7 years agoMerge pull request #1071 from opensourcerouting/isis-spf-debug-guard
Donald Sharp [Tue, 29 Aug 2017 17:05:18 +0000 (13:05 -0400)]
Merge pull request #1071 from opensourcerouting/isis-spf-debug-guard

isisd: guard SPF warning by debug flag

7 years agoMerge pull request #1060 from opensourcerouting/oldbits-2
Donald Sharp [Tue, 29 Aug 2017 13:07:19 +0000 (09:07 -0400)]
Merge pull request #1060 from opensourcerouting/oldbits-2

zebra: clean up blackhole support

7 years agoMerge branch 'master' into dev-master
Mitesh Kanjariya [Tue, 29 Aug 2017 01:19:03 +0000 (18:19 -0700)]
Merge branch 'master' into dev-master

7 years agolib: new APIs for get/set system hostname/domainname
Mitesh Kanjariya [Mon, 28 Aug 2017 23:52:29 +0000 (16:52 -0700)]
lib: new APIs for get/set system hostname/domainname

1. Change hostname_get to cmd_hostname_get
2. Change domainname_get to cmd_domainname_get
3. New API to set domainname
3. Provide a CLI command to set domainname

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoMerge pull request #1041 (-funwind-tables)
David Lamparter [Mon, 28 Aug 2017 23:05:05 +0000 (01:05 +0200)]
Merge pull request #1041 (-funwind-tables)

7 years agoconfigure: Add `-funwind-tables`
Donald Sharp [Thu, 24 Aug 2017 16:16:24 +0000 (12:16 -0400)]
configure: Add `-funwind-tables`

Certain platforms( ARM comes to mind ) in order
to get a proper stack trace on crash you need
to compile with this value.  Since it only
slightly increases the size of the binary for
other platforms, I would consider it worthwhile
to include this directive.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1065 from qlyoung/no-ospf6-router-id
David Lamparter [Mon, 28 Aug 2017 22:37:26 +0000 (00:37 +0200)]
Merge pull request #1065 from qlyoung/no-ospf6-router-id

no ospf6 router-id

7 years agoisisd: guard SPF warning by debug flag
Christian Franke [Mon, 28 Aug 2017 22:23:53 +0000 (00:23 +0200)]
isisd: guard SPF warning by debug flag

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agoisisd: keep original TLVs when purging in response to confusion
Christian Franke [Mon, 28 Aug 2017 22:14:43 +0000 (00:14 +0200)]
isisd: keep original TLVs when purging in response to confusion

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agoMerge pull request #1066 from nkukard/fix-ordering-of-large-community-config
Donald Sharp [Mon, 28 Aug 2017 20:15:27 +0000 (16:15 -0400)]
Merge pull request #1066 from nkukard/fix-ordering-of-large-community-config

vtysh: Fix for the ordering of large-community lists in config output

7 years agovtysh: Fix for the ordering of large-community lists in config output
Nigel Kukard [Mon, 28 Aug 2017 18:35:15 +0000 (18:35 +0000)]
vtysh: Fix for the ordering of large-community lists in config output

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
7 years agoMerge pull request #1019 from opensourcerouting/zeromq2
ßingen [Mon, 28 Aug 2017 17:55:30 +0000 (19:55 +0200)]
Merge pull request #1019 from opensourcerouting/zeromq2

lib: ZeroMQ read handler, v2

7 years agoospf6d, ospfd: add `no ospf6 router-id ...`
Quentin Young [Mon, 28 Aug 2017 17:38:42 +0000 (13:38 -0400)]
ospf6d, ospfd: add `no ospf6 router-id ...`

* Deprecate `router-id A.B.C.D` for ospf6d
* Add `ospf6 router-id A.B.C.D`
* Add `no ospf6 router-id [A.B.C.D]`
* Add deprecation notices for previously deprecated ospf commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: document frrzmq in its header file
David Lamparter [Mon, 28 Aug 2017 15:59:54 +0000 (17:59 +0200)]
lib: document frrzmq in its header file

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: fix & run ZeroMQ test
David Lamparter [Mon, 28 Aug 2017 15:20:38 +0000 (17:20 +0200)]
tests: fix & run ZeroMQ test

add reference output & run the test with proper libs and such.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: add ZeroMQ test
David Lamparter [Thu, 24 Aug 2017 16:13:31 +0000 (18:13 +0200)]
tests: add ZeroMQ test

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: ZeroMQ read handler, v2
David Lamparter [Wed, 17 May 2017 16:27:54 +0000 (18:27 +0200)]
lib: ZeroMQ read handler, v2

This uses zmq_getsockopt(ZMQ_FD) to create a libfrr read event, which
then wraps zmq_poll and calls an user-specified ZeroMQ read handler.
It's wrapped in a separate library in order to make ZeroMQ support an
installation-time option instead of build-time.

Extended to support per-message and per-fragment callbacks as discussed
with Bingen in PR #566.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib, zebra: carry blackhole type over ZAPI
David Lamparter [Mon, 28 Aug 2017 04:01:13 +0000 (06:01 +0200)]
lib, zebra: carry blackhole type over ZAPI

Allow daemons to add blackholes of specific types (reject/drop.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: netlink: get blackhole routes from kernel
David Lamparter [Fri, 5 Feb 2010 03:58:46 +0000 (04:58 +0100)]
zebra: netlink: get blackhole routes from kernel

support processing of RTN_BLACKHOLE et al. from kernel and dump them
into appropriate blackhole rib entries.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: cleanup blackhole support
David Lamparter [Fri, 5 Feb 2010 03:31:56 +0000 (04:31 +0100)]
zebra: cleanup blackhole support

blackhole support was horribly broken. cleanup by removing blackhole
stuff from ZEBRA_FLAG_*

introduces support for "prohibit" routes (Linux/netlink only)
also clean up blackhole options on "ip route" vty commands.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: rib: use nexthop ptr in rib_add/delete
David Lamparter [Sun, 27 Aug 2017 23:30:16 +0000 (01:30 +0200)]
zebra: rib: use nexthop ptr in rib_add/delete

This simplifies the API for the following blackhole rework.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from API
David Lamparter [Wed, 11 Apr 2012 21:52:46 +0000 (23:52 +0200)]
*: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from API

FLAG_BLACKHOLE is used for different things in different places. remove
it from the zclient API, instead indicate blackholes as proper nexthops
inside the message.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #1054 from dslicenc/eigrp-connected
David Lamparter [Sun, 27 Aug 2017 17:21:55 +0000 (19:21 +0200)]
Merge pull request #1054 from dslicenc/eigrp-connected

eigrpd: add correct interface metrics when interface comes up

7 years agoMerge pull request #1046 from qlyoung/fix-cli-ambiguous
David Lamparter [Sun, 27 Aug 2017 17:20:14 +0000 (19:20 +0200)]
Merge pull request #1046 from qlyoung/fix-cli-ambiguous

fix handling of ambiguous cli

7 years agoMerge pull request #1034 from dwalton76/bgpd-mpls-fec-allocate
David Lamparter [Sun, 27 Aug 2017 17:18:58 +0000 (19:18 +0200)]
Merge pull request #1034 from dwalton76/bgpd-mpls-fec-allocate

Bgpd mpls fec allocate

7 years agoeigrpd: add correct interface metrics when interface comes up
Don Slice [Sat, 26 Aug 2017 19:51:43 +0000 (15:51 -0400)]
eigrpd: add correct interface metrics when interface comes up

Problem noticed where we were not sending the correct metric values
to our peers for connected interfaces.  Found that we were not storing
these values on the structure used to send the update packets.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
7 years agoMerge pull request #1049 from opensourcerouting/openbsd-warnings
Donald Sharp [Sat, 26 Aug 2017 12:05:36 +0000 (08:05 -0400)]
Merge pull request #1049 from opensourcerouting/openbsd-warnings

fix warnings on OpenBSD

7 years agoisisd: bpf: ETHER_HDR_LEN -> ETH_ALEN
David Lamparter [Fri, 25 Aug 2017 23:52:12 +0000 (01:52 +0200)]
isisd: bpf: ETHER_HDR_LEN -> ETH_ALEN

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: remove RT_ROUNDUP warning
David Lamparter [Fri, 25 Aug 2017 23:41:07 +0000 (01:41 +0200)]
zebra: remove RT_ROUNDUP warning

This warning is at odds with how the world works.  Also, the code is
correct on all platforms we care about.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: prefix: fix char value size
David Lamparter [Fri, 25 Aug 2017 23:38:10 +0000 (01:38 +0200)]
lib: prefix: fix char value size

There are 16 bytes here, not 8.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: encap: fix extension sizing
David Lamparter [Fri, 25 Aug 2017 23:27:22 +0000 (01:27 +0200)]
bgpd: encap: fix extension sizing

Variably-sized struct tails are done as [0], not [1].  The latter
triggers compiler warnings and mis-sizes "sizeof(struct) + n"
expressions.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix compiler warnings
David Lamparter [Fri, 25 Aug 2017 23:14:25 +0000 (01:14 +0200)]
*: fix compiler warnings

Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these;  they're bogus
(gcc 4.2, being rather old, isn't quite as "intelligent" as newer
versions; the newer ones apply more logic and less warnings.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoHandle hostname/domainname properly for FreeBSD
Mitesh Kanjariya [Fri, 25 Aug 2017 23:36:31 +0000 (16:36 -0700)]
Handle hostname/domainname properly for FreeBSD

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoFix compilation errors for domainname
Mitesh Kanjariya [Fri, 25 Aug 2017 22:51:16 +0000 (15:51 -0700)]
Fix compilation errors for domainname

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agolib: Fix make check failures
Mitesh Kanjariya [Fri, 25 Aug 2017 22:26:33 +0000 (15:26 -0700)]
lib: Fix make check failures

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agolib: remove static variable from cli matcher
Quentin Young [Fri, 25 Aug 2017 18:08:16 +0000 (14:08 -0400)]
lib: remove static variable from cli matcher

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: fix rare bug in ambiguous command resolution
Quentin Young [Fri, 25 Aug 2017 17:39:13 +0000 (13:39 -0400)]
lib: fix rare bug in ambiguous command resolution

In certain situations, the CLI matcher would not handle ambiguous
commands properly. If it found an ambiguous result in a lower subgraph,
the ambiguous result would not correctly propagate up to previous frames
in the resolution DFS as ambiguous; instead it would propagate up as a
non-match, which could subsequently be overridden by a partial match.

Example CLI space:

  show ip route summary
  show ip route supernet-only
  show ipv6 route summary

Entering `show ip route su` would result in an ambiguous resolution for
the `show ip route` subgraph but would propagate up to the `show ip`
subgraph as a no-match, allowing `ip` to partial-match `ipv6` and
execute that command.

In this example entering `show ip route summary` would disambiguate the
`show ip` subgraph. So this bug would only appear when entering input
that caused ambiguities in at least two parallel subgraphs.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #1045 from opensourcerouting/clippy-coverity
Donald Sharp [Fri, 25 Aug 2017 17:51:46 +0000 (13:51 -0400)]
Merge pull request #1045 from opensourcerouting/clippy-coverity

clippy: disable unneeded autogenerated code

7 years agoclippy: disable unneeded autogenerated code
David Lamparter [Fri, 25 Aug 2017 16:54:13 +0000 (18:54 +0200)]
clippy: disable unneeded autogenerated code

Coverity is generating a lot of warnings about unused stuff being
around.  Disabling these bits is most easily done by just putting a few
preprocessor directives into the template.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoprovide/use API to get hostname/domainname
Mitesh Kanjariya [Mon, 21 Aug 2017 21:56:06 +0000 (14:56 -0700)]
provide/use API to get hostname/domainname

Set default hostname in frr to unix hostname.
Provide APIs to get the hostname/domaninanme
Use this APIs where needed

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agolib/bgpd: provide/use API to get hostname/domainname
Mitesh Kanjariya [Mon, 21 Aug 2017 21:56:06 +0000 (14:56 -0700)]
lib/bgpd: provide/use API to get hostname/domainname

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoMerge pull request #1037 from donaldsharp/eigrp_split_horizon
Donnie Savage [Thu, 24 Aug 2017 19:39:46 +0000 (15:39 -0400)]
Merge pull request #1037 from donaldsharp/eigrp_split_horizon

Eigrp split horizon and ipv4 to prefix changes approved

7 years agoMerge pull request #1040 from donaldsharp/sgrpt
Jafar Al-Gharaibeh [Thu, 24 Aug 2017 16:41:38 +0000 (11:41 -0500)]
Merge pull request #1040 from donaldsharp/sgrpt

Sgrpt

7 years agopimd: Cleanup S,GRPt prune handling on Mroute Loss
Donald Sharp [Thu, 24 Aug 2017 13:55:19 +0000 (09:55 -0400)]
pimd: Cleanup S,GRPt prune handling on Mroute Loss

1) Clean up display of S,GRPt prune state to be more meaningful
2) Upon receipt of a S,GRPt prune make sure we transition to
   the correct state
3) Upon loss of a S,GRPt prune make sure we transition to
   the correct state as well as immediately send a *,G
   join upstream to propagate the loss of the prune.
4) Removal of a weird S,G state being installed upon
   loss of a S,G RPt prune.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup a debug for vrf
Donald Sharp [Thu, 24 Aug 2017 13:53:05 +0000 (09:53 -0400)]
pimd: Cleanup a debug for vrf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1038 from donaldsharp/zserv
Renato Westphal [Thu, 24 Aug 2017 13:26:31 +0000 (10:26 -0300)]
Merge pull request #1038 from donaldsharp/zserv

zebra: Fix compiler warnings

7 years agoMerge pull request #1031 from opensourcerouting/small-bits
Donald Sharp [Thu, 24 Aug 2017 12:58:46 +0000 (08:58 -0400)]
Merge pull request #1031 from opensourcerouting/small-bits

small bits

7 years agolib: Fix nexthop num
Donald Sharp [Thu, 24 Aug 2017 12:30:08 +0000 (08:30 -0400)]
lib: Fix nexthop num

If we assign MULTIPATH_NUM to be 256, this causes issues
for us since 256 is bigger than a u_char.  So let's make
the api's multipath_num to be a u_int16_t and pass it
around as a word.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix distance comparison
Donald Sharp [Thu, 24 Aug 2017 11:34:21 +0000 (07:34 -0400)]
eigrpd: Fix distance comparison

The distance comparison for when we received an
internal and we already had an internal was
overriding the metrics of the connected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix compiler warning introduced
Donald Sharp [Thu, 24 Aug 2017 00:26:19 +0000 (20:26 -0400)]
eigrpd: Fix compiler warning introduced

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove 'struct prefix_ipv4' from eigrp_network.c
Donald Sharp [Wed, 23 Aug 2017 19:39:30 +0000 (15:39 -0400)]
eigrpd: Remove 'struct prefix_ipv4' from eigrp_network.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove 'struct prefix_ipv4' from eigrp_interface.c
Donald Sharp [Wed, 23 Aug 2017 19:38:29 +0000 (15:38 -0400)]
eigrpd: Remove 'struct prefix_ipv4' from eigrp_interface.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Refactor eigrp_network_[un]set to use prefix
Donald Sharp [Wed, 23 Aug 2017 19:35:27 +0000 (15:35 -0400)]
eigrpd: Refactor eigrp_network_[un]set to use prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Refactor eigrp_topoloy_table_lookup_ipv4
Donald Sharp [Wed, 23 Aug 2017 19:31:02 +0000 (15:31 -0400)]
eigrpd: Refactor eigrp_topoloy_table_lookup_ipv4

Allow eigrp_topology_table_lookup_ipv4 to use
'struct prefix'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Refactor to use 'struct prefix' for eigrp_zebra.h
Donald Sharp [Wed, 23 Aug 2017 18:36:06 +0000 (14:36 -0400)]
eigrpd: Refactor to use 'struct prefix' for eigrp_zebra.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Convert pe->destination_ipv4 to pe->destination
Donald Sharp [Wed, 23 Aug 2017 18:19:45 +0000 (14:19 -0400)]
eigrpd: Convert pe->destination_ipv4 to pe->destination

Convert the destination_ipv4 to a struct prefix and just
call it destination.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Use FSM for interface pe already known.
Donald Sharp [Wed, 23 Aug 2017 17:26:50 +0000 (13:26 -0400)]
eigrpd: Use FSM for interface pe already known.

There exists a case where a switch already has
a eigrp_prefix_entry for a interface that is
coming up.

In this situation, we need to use the FSM
to let the connected route take precedence
instead of blindly just updating the world
about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: No need to create TLV type
Donald Sharp [Tue, 22 Aug 2017 23:48:23 +0000 (19:48 -0400)]
eigrpd: No need to create TLV type

There is no need to create a TLV type to pass in for the
FSM message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove union from FSM msg
Donald Sharp [Tue, 22 Aug 2017 23:19:10 +0000 (19:19 -0400)]
eigrpd: Remove union from FSM msg

Remove the union of passing the TLV and just pass the metric in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Improve external route distance comparison
Donald Sharp [Tue, 22 Aug 2017 20:24:23 +0000 (16:24 -0400)]
eigrpd: Improve external route distance comparison

If the new nexthop is external while the previous
best was Internal or Connected, it should always loose.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: make fsm msg data_type an enum
Donald Sharp [Tue, 22 Aug 2017 20:19:23 +0000 (16:19 -0400)]
eigrpd: make fsm msg data_type an enum

We need to eventually be able to handle multiple
data types to figure out if the distance is better
worse.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Refactor FSM calling
Donald Sharp [Tue, 22 Aug 2017 19:43:30 +0000 (15:43 -0400)]
eigrpd: Refactor FSM calling

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix memory leak in FSM
Donald Sharp [Tue, 22 Aug 2017 19:39:18 +0000 (15:39 -0400)]
eigrpd: Fix memory leak in FSM

The FSM was never freeing the msg.  Since we
do not have a special queue for it, just don't
allocate the memory.  In the future we can put
this back.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Cleanup list accessors
Donald Sharp [Tue, 22 Aug 2017 18:53:14 +0000 (14:53 -0400)]
eigrpd: Cleanup list accessors

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove unnecessary check
Donald Sharp [Tue, 22 Aug 2017 18:42:43 +0000 (14:42 -0400)]
eigrpd: Remove unnecessary check

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Start split-horizon
Donald Sharp [Tue, 22 Aug 2017 18:40:24 +0000 (14:40 -0400)]
eigrpd: Start split-horizon

EIGRP was not handling split-horizon.  This code starts
down the path of properly considering it.  There still
exists situations where we are not properly handling it
though.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix compiler warnings
Donald Sharp [Thu, 24 Aug 2017 12:02:27 +0000 (08:02 -0400)]
zebra: Fix compiler warnings

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1022 from opensourcerouting/zapi_consolidation
Donald Sharp [Thu, 24 Aug 2017 10:03:55 +0000 (06:03 -0400)]
Merge pull request #1022 from opensourcerouting/zapi_consolidation

Zapi consolidation

7 years agolib: mark the old zebra API for route advertisement as deprecated
Renato Westphal [Wed, 23 Aug 2017 22:12:48 +0000 (19:12 -0300)]
lib: mark the old zebra API for route advertisement as deprecated

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospf6d: fix regression detected by topotest
Renato Westphal [Mon, 21 Aug 2017 22:43:43 +0000 (19:43 -0300)]
ospf6d: fix regression detected by topotest

With the old API, ospf6d always needed to send a nexthop address and a
nexthop interface when advertising a route to zebra. In the case where
the nexthop address didn't exist (e.g. connected route), zebra would
take care of ignore it in the zread_ipv6_add() function.

Now, if we have a nexthop interface but not a nexthop address, we not
only can but we should send a nexthop of type NEXTHOP_TYPE_IFINDEX. zebra
won't fix bad nexthops anymore because the clients have a proper API to
send correct messages.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: use zapi_route to send/receive redistributed routes as well
Renato Westphal [Mon, 21 Aug 2017 01:10:50 +0000 (22:10 -0300)]
*: use zapi_route to send/receive redistributed routes as well

Some differences compared to the old API:
* Now the redistributed routes are sent using address-family
  independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and
  ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6
  zclient callbacks in the client daemons and thus remove a lot of
  duplicate code;

* Now zebra sends all nexthops of the redistributed routes to the client
  daemons, not only the first one. This shouldn't have any noticeable
  performance implications and will allow us to remove an ugly exception
  we had for ldpd (which needs to know all nexthops of the redistributed
  routes). The other client daemons can simply ignore the nexthops if
  they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:36:44 +0000 (21:36 -0300)]
bgpd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agonhrpd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:36:35 +0000 (21:36 -0300)]
nhrpd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:29:35 +0000 (21:29 -0300)]
isisd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:19:25 +0000 (21:19 -0300)]
bgpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #1026 from qlyoung/no-ospf6
David Lamparter [Wed, 23 Aug 2017 22:24:57 +0000 (00:24 +0200)]
Merge pull request #1026 from qlyoung/no-ospf6

ospf6d: add `no` forms for interface commands

7 years agolib: split off compiler magic into its own file
David Lamparter [Wed, 23 Aug 2017 18:22:31 +0000 (20:22 +0200)]
lib: split off compiler magic into its own file

Also make timed notices available via CONFDATE.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix libtool stupidity wrt. parallel install
David Lamparter [Wed, 23 Aug 2017 13:45:05 +0000 (15:45 +0200)]
build: fix libtool stupidity wrt. parallel install

there's no dependency between libraries and other things to be
installed, but libtool in its 90ies design wants to relink libraries
when installing them.  Add manual dependencies to work around this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: prefix: try harder to not hash garbage
David Lamparter [Wed, 23 Aug 2017 16:51:18 +0000 (18:51 +0200)]
lib: prefix: try harder to not hash garbage

With prefix_ptr or prefix_ls, there can still be stuff in a struct
prefix that we shouldn't hash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: fix stats counting for IPv6
David Lamparter [Wed, 23 Aug 2017 16:21:30 +0000 (18:21 +0200)]
bgpd: fix stats counting for IPv6

Fixes: #991
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agopython/clippy: make output file writing less weird
David Lamparter [Wed, 23 Aug 2017 15:33:17 +0000 (17:33 +0200)]
python/clippy: make output file writing less weird

This should stomp out any parallel build issues in this regard.

Fixes: #971
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: better warnings for install_element
David Lamparter [Wed, 23 Aug 2017 15:06:24 +0000 (17:06 +0200)]
lib: better warnings for install_element

Also fixes misuse of vector_slot() - that one doesn't check for access
beyond end of vector...

And print node names in grammar sandbox "printall".

Fixes: #543
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospf6d: properly update prefix list references
David Lamparter [Wed, 23 Aug 2017 14:54:15 +0000 (16:54 +0200)]
ospf6d: properly update prefix list references

Register add/delete hooks with the prefix list code to properly change
ospf6_area's prefix list in/out pointers.

There are 2 other uncached uses of prefix lists in the ASBR route-map
code and the interface code;  these should probably be cached too. (To
be fixed another day...)

Fixes: #453
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: fix cosmetic issue with exit race
David Lamparter [Wed, 23 Aug 2017 14:23:17 +0000 (16:23 +0200)]
lib: fix cosmetic issue with exit race

if we're using --terminal, the daemon may in some cases exit fast enough
for the parent to see this; this resulted in a confusing/bogus "failed
to start, exited 0" message.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: centralized memstats-at-exit
David Lamparter [Wed, 23 Aug 2017 14:18:49 +0000 (16:18 +0200)]
lib: centralized memstats-at-exit

adds a new all-daemon "debug memstats-at-exit" command.  Also saves
memstats to a file in /tmp, useful if a long-running daemon is having
weird issues (e.g. in a user install).

Fixes: #437
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospf6d: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:19:07 +0000 (21:19 -0300)]
ospf6d: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospfd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:58 +0000 (21:18 -0300)]
ospfd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agonhrpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:50 +0000 (21:18 -0300)]
nhrpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:36 +0000 (21:18 -0300)]
isisd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoeigrpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:17:59 +0000 (21:17 -0300)]
eigrpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd/ripngd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:17:09 +0000 (21:17 -0300)]
ripd/ripngd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozapi: add support for routes with multiple labels
Renato Westphal [Sun, 20 Aug 2017 22:57:36 +0000 (19:57 -0300)]
zapi: add support for routes with multiple labels

This will be necessary for the Segment Routing feature.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobabeld: unify kernel_route_v4() and kernel_route_v6()
Renato Westphal [Sun, 20 Aug 2017 01:31:32 +0000 (22:31 -0300)]
babeld: unify kernel_route_v4() and kernel_route_v6()

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib/zserv: introduce address-family independent ZAPI message types
Renato Westphal [Sun, 20 Aug 2017 00:59:41 +0000 (21:59 -0300)]
lib/zserv: introduce address-family independent ZAPI message types

As noticed in 657cde1, the zapi_ipv[4|6]_route functions are broken in
many ways and that's the reason that many client daemons (e.g. ospfd,
isisd) need to send handcrafted messages to zebra.

The zapi_route() function introduced by Donald solves the problem
by providing a consistent way to send ipv4/ipv6 routes to zebra with
nexthops of any type, in all possible combinations including IPv4 routes
with IPv6 nexthops (for BGP unnumbered routes).

This patch goes a bit further and creates two new address-family
independent ZAPI message types that the client daemons can
use to advertise route information to zebra: ZEBRA_ROUTE_ADD and
ZEBRA_ROUTE_DELETE. The big advantage of having address-family independent
messages is that it allows us to remove a lot of duplicate code in zebra
and in the client daemons.

This patch also introduces the zapi_route_decode() function. It will be
used by zebra to decode route messages sent by the client daemons using
zclient_route_send(), which calls zapi_route_encode().

Later on we'll use this same pair of encode/decode functions to
send/receive redistributed routes from zebra to the client daemons,
taking the idea of removing code duplication to the next level.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: updates to zapi_route
Renato Westphal [Sun, 20 Aug 2017 00:25:12 +0000 (21:25 -0300)]
lib: updates to zapi_route

This patch introduces the following changes to the zapi_route structure
and associated code:
* Use a fixed-size array to store the nexthops instead of a pointer. This
  makes the zapi_route() function much easier to use when we have multiple
  nexthops to send. It's also much more efficient to put everything on
  the stack rather than allocating an array in the heap every time we
  need to send a route to zebra;

* Use the new 'zapi_nexthop' structure. This will allow the client daemons
  to send labeled routes without having to allocate memory for the labels
  (the 'nexthop' structure was designed to be memory efficient and doesn't
  have room for MPLS labels, only a pointer). Also, 'zapi_nexthop' is more
  compact and more clean from an API perspective;

* Embed the route prefix inside the zapi_route structure. Since the
  route's prefix is sent along with its nexthops and attributes, it makes
  sense to pack everything inside the same structure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozserv: identify label type based on the client protocol
Renato Westphal [Sat, 19 Aug 2017 23:00:25 +0000 (20:00 -0300)]
zserv: identify label type based on the client protocol

This fixes a problem where the type of the BGP-LU labels was not
being set.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozserv: simplify handling of route delete requests
Renato Westphal [Sat, 19 Aug 2017 17:26:00 +0000 (14:26 -0300)]
zserv: simplify handling of route delete requests

Route attributes like tag, distance and metric are irrelevant when we
want to delete a route from a client daemon. The same can be said about
the nexthops of the route. Only the IP prefix and client protocol are
enough to identify the route we want to remove, considering that zebra
maintains at most one route from each client daemon for each prefix. Once
rib_delete() is called, it deletes the selected route with all of its
nexthops.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>