]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agozebra,lib: use const in more apis
Mark Stapp [Fri, 8 Nov 2019 19:13:33 +0000 (14:13 -0500)]
zebra,lib: use const in more apis

Use const with some args to ipaddr, zebra vxlan, mpls
lsp, and nexthop apis; add some extra checks to some
nexthop-related apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5740 from sworleys/NHG-2Grp-Fixes
Mark Stapp [Fri, 27 Mar 2020 13:25:18 +0000 (09:25 -0400)]
Merge pull request #5740 from sworleys/NHG-2Grp-Fixes

zebra: NHG fixes in the dataplane conversion function

4 years agoMerge pull request #6084 from sarav511/wrvif_crash
Donald Sharp [Fri, 27 Mar 2020 02:46:01 +0000 (22:46 -0400)]
Merge pull request #6084 from sarav511/wrvif_crash

pimd: avoiding crash in wrvifwhole path

4 years agoMerge pull request #6094 from sworleys/NHG-Fix-Src
Sri Mohana Singamsetty [Fri, 27 Mar 2020 02:08:32 +0000 (19:08 -0700)]
Merge pull request #6094 from sworleys/NHG-Fix-Src

zebra: determine src with nexthop objects as well

4 years agoMerge pull request #6085 from donaldsharp/bgp_node_get_prefix
Sri Mohana Singamsetty [Fri, 27 Mar 2020 02:07:36 +0000 (19:07 -0700)]
Merge pull request #6085 from donaldsharp/bgp_node_get_prefix

Bgp node get prefix

4 years agoMerge pull request #6092 from ton31337/fix/error_message_for_aggregator
Donald Sharp [Fri, 27 Mar 2020 02:07:02 +0000 (22:07 -0400)]
Merge pull request #6092 from ton31337/fix/error_message_for_aggregator

bgpd: Print readable error message when parsing AGGREGATOR attribute

4 years agoMerge pull request #5925 from volta-networks/synchronous_client
Renato Westphal [Thu, 26 Mar 2020 20:32:37 +0000 (17:32 -0300)]
Merge pull request #5925 from volta-networks/synchronous_client

zebra: synchronous client queues accumulate messages from zebra

4 years agobgpd: Convert users of `rn->p` to use accessor function
Donald Sharp [Sun, 22 Mar 2020 04:02:18 +0000 (00:02 -0400)]
bgpd: Convert users of `rn->p` to use accessor function

Add new function `bgp_node_get_prefix()` and modify
the bgp code base to use it.

This is prep work for the struct bgp_dest rework.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib, bgpd: Another round of `struct const prefix` cleanup
Donald Sharp [Tue, 24 Mar 2020 11:58:08 +0000 (07:58 -0400)]
lib, bgpd: Another round of `struct const prefix` cleanup

Cleanup another set of functions that need to respect the
const'ness of a prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: make oid_copy_addr respect my constness
Donald Sharp [Tue, 24 Mar 2020 14:20:54 +0000 (10:20 -0400)]
lib: make oid_copy_addr respect my constness

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Refactor vnc_import_bgp_redist_table
Donald Sharp [Tue, 24 Mar 2020 14:09:01 +0000 (10:09 -0400)]
bgpd: Refactor vnc_import_bgp_redist_table

This function is heavily indented and hard to read
Make it easier to read.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: break if duplicate nexthop found in nhe2grp
Stephen Worley [Thu, 26 Mar 2020 14:57:45 +0000 (10:57 -0400)]
zebra: break if duplicate nexthop found in nhe2grp

If we find that a nexthop is a duplicate, break immediately
rather than continuing to look through the rest of the list.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: properly set the NEXTHOP_GROUP_VALID flag
Stephen Worley [Thu, 30 Jan 2020 21:43:09 +0000 (16:43 -0500)]
zebra: properly set the NEXTHOP_GROUP_VALID flag

Properly set the NEXTHOP_GROUP_VALID flag and use it
as a conditional for installation decisions for individual
nexthop and groups containing it.

We set the NEXTHOP_GROUP_VALID flag it is:

1) A fully resolved active nexthop
or
2) Its a group that contains at least one VALID NHE

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: set valid on re->nhe directly in nexthop_active_update()
Stephen Worley [Thu, 30 Jan 2020 17:34:35 +0000 (12:34 -0500)]
zebra: set valid on re->nhe directly in nexthop_active_update()

We were still doing a lookup on the nhe_id from before we
started referencing re->nhe directly.

Change set flag to just use re->nhe directly here since they
should always be the same at this point in the code anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: add debug for duplicate NH in dataplane array conversion
Stephen Worley [Tue, 28 Jan 2020 20:20:18 +0000 (15:20 -0500)]
zebra: add debug for duplicate NH in dataplane array conversion

When we find a nexthop ID thats a duplicate in the code that converts
NHG rb trees into a flat list of nexthop IDs for the dataplane,
output a debug message.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: don't add ID to kernel nh_grp if not installed/queued
Stephen Worley [Tue, 28 Jan 2020 19:33:10 +0000 (14:33 -0500)]
zebra: don't add ID to kernel nh_grp if not installed/queued

When we transform the nexthop group rb trees into a flat
array of IDs to send into the dataplane code (zebra_nhg_nhe2grp),
don't put an ID in there that has not been in installed or is
not currently queued to be installed into the dataplane.

Otherwise, if some of the nexthops fail to install, we will
still try to create a group with them and then the entire group
will fail.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: handle NHG in NHG dataplane group conversion
Stephen Worley [Tue, 28 Jan 2020 00:36:01 +0000 (19:36 -0500)]
zebra: handle NHG in NHG dataplane group conversion

We were not properly handling the case of a NHG inside of
another NHG when converting the rb tree of a multilevel NHG
into a flat list of IDs. When constructing, we call the function
zebra_nhg_nhe2grp_internal() recursively so that the rare
case of a group within a group is handled such that its
singleton nexthops are appended to the grp array of IDs
we send to the dataplane code.

Ex)

1:
-> 2:
-> 3
-> 4
->5:
->6

becomes this:

1:
->3
->4
->6

when its sent to the dataplane code for final kernel installation.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: remove unnecessary `cmd =` check
Stephen Worley [Thu, 26 Mar 2020 14:39:16 +0000 (10:39 -0400)]
zebra: remove unnecessary `cmd =` check

In the netlink code for determining whether to set
a src on the route, we check if the cmd=NEW_ROUTE
but its not possible for this to ever be anything
but a new route since we do a goto skip further up
if its a DEL_ROUTE cmd.

So remove this unnecessary check.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: determine src when using nexthop objects
Stephen Worley [Tue, 24 Mar 2020 21:32:21 +0000 (17:32 -0400)]
zebra: determine src when using nexthop objects

Determine src based on nexthop data even when we are using
kernel nexthop objects.

Before, we were entirely skipping this step and just sending the
nexthop ID, ignoring src determination.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: abstract route src determiniation into func
Stephen Worley [Tue, 24 Mar 2020 21:10:08 +0000 (17:10 -0400)]
zebra: abstract route src determiniation into func

Abstraction the route src determination from a nexthop in the
netlink code into a function for both singlepath and mutlipath
to call.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agobgpd: Show that prefix is malformed if aggregated by 0
Donatas Abraitis [Thu, 26 Mar 2020 14:06:34 +0000 (16:06 +0200)]
bgpd: Show that prefix is malformed if aggregated by 0

Show if this malformed under `show [ip] bgp <prefix>`:
 ```
eva# sh ip bgp 103.79.124.0/22
BGP routing table entry for 103.79.124.0/22
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.201.136
  64539 15096 6939 7545 7545 136001, (aggregated by 0(malformed) 0.0.0.0)
    192.168.201.136 from 192.168.201.136 (192.168.201.136)
      Origin IGP, valid, external, best (First path received)
      Last update: Thu Mar 26 10:02:07 2020
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Print readable error message when parsing AGGREGATOR attribute
Donatas Abraitis [Thu, 26 Mar 2020 14:06:00 +0000 (16:06 +0200)]
bgpd: Print readable error message when parsing AGGREGATOR attribute

Having a full feed this leads to unknown. You can't point which prefix or
aspath has this malforming behavior.

Printing just `[EC 33554434] AGGREGATOR attribute is BGP_AS_ZERO(0)` isn't
enough, you can't directly pin-point where is the problem.

Additionally print at least aspath here:
```
[EC 33554434] AGGREGATOR AS number is 0 for aspath: 65000 65031
```

Overall the full table has only 6 such malformed prefixes:
```
aspath: 64539 15096 6939 45430 45458
aspath: 64539 15096 6939 1299 3257 34984 34984 34984 34984 34984 51174
aspath: 64539 15096 6939 286 34984 16135 16135 {16135}
aspath: 64539 15096 6939 7545 7545 136001
aspath: 64539 15096 6939 6762 3269 20746
aspath: 64539 15096 6939 7018 3379
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6091 from volta-networks/fix_isis_show_hello
Quentin Young [Wed, 25 Mar 2020 17:05:34 +0000 (13:05 -0400)]
Merge pull request #6091 from volta-networks/fix_isis_show_hello

isisd: fix more mismatches between vty command and show config

4 years agoisisd: fix hello cmds vtysh output
Emanuele Di Pascale [Wed, 25 Mar 2020 15:19:01 +0000 (16:19 +0100)]
isisd: fix hello cmds vtysh output

once again, for both hello-multiplier and hello-interval
the order in which the number and level were shown in the
cli_show methods was inverted compared to the vtysh command,
which created issues with frr-reload.py.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoMerge pull request #6079 from sarav511/regstop_exp
Donald Sharp [Wed, 25 Mar 2020 10:32:42 +0000 (06:32 -0400)]
Merge pull request #6079 from sarav511/regstop_exp

pimd: Reg Suppression expiry has to account for couldreg->false while in RegPrune

4 years agoMerge pull request #6087 from opensourcerouting/log-kill-tabs
Donald Sharp [Wed, 25 Mar 2020 10:30:38 +0000 (06:30 -0400)]
Merge pull request #6087 from opensourcerouting/log-kill-tabs

*: remove tabs and linefeeds from log messages

4 years agoMerge pull request #6081 from dslicenc/import-vrf-routemap
Russ White [Tue, 24 Mar 2020 19:57:28 +0000 (15:57 -0400)]
Merge pull request #6081 from dslicenc/import-vrf-routemap

bgpd: clean up import vrf route-map command

4 years agolib: rewrite zlog_hexdump()
David Lamparter [Tue, 24 Mar 2020 18:37:58 +0000 (19:37 +0100)]
lib: rewrite zlog_hexdump()

The old version was creating a multi-line log message, which we can't
properly handle right now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years ago*: remove line breaks from log messages
David Lamparter [Tue, 24 Mar 2020 18:15:04 +0000 (19:15 +0100)]
*: remove line breaks from log messages

Line break at the end of the message is implicit for zlog_* and flog_*,
don't put it in the string.  Mid-message line breaks are currently
unsupported.  (LF is "end of message" in syslog.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoMerge pull request #5713 from opensourcerouting/logpump
Quentin Young [Tue, 24 Mar 2020 18:06:06 +0000 (14:06 -0400)]
Merge pull request #5713 from opensourcerouting/logpump

sharpd: add "logpump" to bulk test logging

4 years ago*: remove tabs from log messages
David Lamparter [Tue, 24 Mar 2020 16:38:20 +0000 (17:38 +0100)]
*: remove tabs from log messages

Some logging systems are, er, "allergic" to tabs in log messages.
(RFC5424: "The syslog application SHOULD avoid octet values below 32")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoMerge pull request #6080 from sarav511/buf_inc
Quentin Young [Tue, 24 Mar 2020 16:29:47 +0000 (12:29 -0400)]
Merge pull request #6080 from sarav511/buf_inc

pimd: increase buffer size for prefix str while printing bsrp-info

4 years agoMerge pull request #6035 from qlyoung/fix-nexthop-label-nullity-before-free
Santosh P K [Tue, 24 Mar 2020 15:59:06 +0000 (21:29 +0530)]
Merge pull request #6035 from qlyoung/fix-nexthop-label-nullity-before-free

lib: remove null check before free nh_labels

4 years agosharpd: add "logpump" to bulk test logging
David Lamparter [Tue, 10 Dec 2019 16:23:25 +0000 (17:23 +0100)]
sharpd: add "logpump" to bulk test logging

This just generates log messages in bulk for testing logging backend
performance.  It's in sharpd so the full "context" of being in a daemon
is available (e.g. different logging configs, parallel load in the main
thread.)

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #6068 from donaldsharp/agg_to_use_rn_lookup
Russ White [Tue, 24 Mar 2020 14:49:36 +0000 (10:49 -0400)]
Merge pull request #6068 from donaldsharp/agg_to_use_rn_lookup

Agg to use rn lookup

4 years agoMerge pull request #6050 from sworleys/PBR-No-Fail-Same-VRF
Russ White [Tue, 24 Mar 2020 14:28:41 +0000 (10:28 -0400)]
Merge pull request #6050 from sworleys/PBR-No-Fail-Same-VRF

pbrd: properly handle duplicate set vrf XX configs

4 years agoMerge pull request #6047 from sarav511/hold0
Russ White [Tue, 24 Mar 2020 14:19:17 +0000 (10:19 -0400)]
Merge pull request #6047 from sarav511/hold0

pimd: Pim hello should be sent with 0 hold time on address change onold src ip

4 years agoMerge pull request #6024 from patrasar/mroute_reshape
Russ White [Tue, 24 Mar 2020 14:16:43 +0000 (10:16 -0400)]
Merge pull request #6024 from patrasar/mroute_reshape

pimd: re-shaping show ip mroute outout

4 years agoMerge pull request #6015 from sarav511/bsmfwd
Russ White [Tue, 24 Mar 2020 14:11:29 +0000 (10:11 -0400)]
Merge pull request #6015 from sarav511/bsmfwd

pimd: Do not forward BSM to interfaces that has no pim neighbors

4 years agoMerge pull request #6010 from sarav511/uni_jn_ig
Russ White [Tue, 24 Mar 2020 14:08:29 +0000 (10:08 -0400)]
Merge pull request #6010 from sarav511/uni_jn_ig

pimd: Ignore PIM Join/Prune, Assert and Hello without all-pim-routers address as dest IP

4 years agobgpd: clean up import vrf route-map command
Don Slice [Mon, 9 Mar 2020 18:34:53 +0000 (18:34 +0000)]
bgpd: clean up import vrf route-map command

Problem seen that if "import vrf route-map RMAP" was entered
without any vrfs being imported, the configuration was displayed
as "route-map vpn import RMAP". Additionally, if "import vrf
route-map" was entered without specifying a route-map name,
the command was accepted and the word "route-map" would be
treated as a vrf name.  This fix resolves both of those issues
and also allows deleting the "import vrf route-map" line without
providing the route-map name.

Ticket: CM-28821
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd, lib, ripngd: Add agg_node_get_prefix
Donald Sharp [Sun, 22 Mar 2020 03:37:24 +0000 (23:37 -0400)]
bgpd, lib, ripngd: Add agg_node_get_prefix

Modify code to use lookup function agg_node_get_prefix()
as the abstraction layer.  When we rework bgp_node to
bgp_dest this will allow us to greatly limit the amount
of work needed to do that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Rework code to use `const struct prefix`
Donald Sharp [Sun, 22 Mar 2020 01:56:36 +0000 (21:56 -0400)]
bgpd: Rework code to use `const struct prefix`

Future work needs the ability to specify a
const struct prefix value.  Iterate into
bgp a bit to get this started.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd, isisd, lib: Make key values const for skiplist
Donald Sharp [Sun, 22 Mar 2020 02:56:03 +0000 (22:56 -0400)]
bgpd, isisd, lib: Make key values const for skiplist

Make some key values const for the skiplist code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Make bgp_debug_bestpath take a `struct bgp_node`
Donald Sharp [Sat, 21 Mar 2020 21:36:48 +0000 (17:36 -0400)]
bgpd: Make bgp_debug_bestpath take a `struct bgp_node`

Defer the grabbing of the prefix for as long as is possible.
This is a long term rework of how we access the `struct bgp_node`
to only use accessor functions.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6072 from sarav511/bsrelect
Donald Sharp [Tue, 24 Mar 2020 10:29:04 +0000 (06:29 -0400)]
Merge pull request #6072 from sarav511/bsrelect

pimd: bsr election elects wrong bsr

4 years agopimd: Reg Suppression expiry has to account for couldreg->false while in prune
saravanank [Tue, 24 Mar 2020 02:57:17 +0000 (19:57 -0700)]
pimd: Reg Suppression expiry has to account for couldreg->false while in prune

Problem: This happened in once in a while during testing the scenario multiple
times. When regstop timer expire and at that point if rpf interface doesn't
exist, the register state for the upstream gets struck in reg-prune state indefinitely.
This will not recover even when rpf comes back and traffic resumed because
register state is struck on prune.

RCA: Reg suppression expiry is keeping reg state unchanged when iif is absent.

Fix: When iif is absent during reg suppression expiry, treat it as couldreg
becoming false and move it NO_INFO state.

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agopimd: avoiding crash in wrvifwhole path
saravanank [Tue, 24 Mar 2020 08:26:25 +0000 (01:26 -0700)]
pimd: avoiding crash in wrvifwhole path

Observed crash in the wrvif whole path.

RCA: Wrongvif path trying to access pim attributes of pim disabled RPF interface.
This was resulting in Null access.

(gdb) p/x rpf->source_nexthop
$19 = {last_lookup = {s_addr = 0xa282828}, last_lookup_time = 0x59c0de0828c98,
  interface = 0x1013e5011300, mrib_nexthop_addr = {family = 0x2,
    prefixlen = 0x20, u = {prefix = 0x28, prefix4 = {s_addr = 0xa282828},
      prefix6 = {__in6_u = {__u6_addr8 = {0x28, 0x28, 0x28, 0xa,
            0x0 <repeats 12 times>}, __u6_addr16 = {0x2828, 0xa28, 0x0, 0x0,
            0x0, 0x0, 0x0, 0x0}, __u6_addr32 = {0xa282828, 0x0, 0x0, 0x0}}},
      lp = {id = {s_addr = 0xa282828}, adv_router = {s_addr = 0x0}},
      prefix_eth = {octet = {0x28, 0x28, 0x28, 0xa, 0x0, 0x0}}, val = {0x28,
        0x28, 0x28, 0xa, 0x0 <repeats 12 times>}, ptr = 0xa282828,
      prefix_evpn = {route_type = 0x28, u = {_ead_addr = {esi = {val = {0x0,
                0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, eth_tag = 0x0},
          _macip_addr = {eth_tag = 0x0, ip_prefix_length = 0x0, mac = {
              octet = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, ip = {ipa_type = 0x0,
              ip = {addr = 0x0, _v4_addr = {s_addr = 0x0}, _v6_addr = {
                  __in6_u = {__u6_addr8 = {0x0 <repeats 16 times>},
                    __u6_addr16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
                    __u6_addr32 = {0x0, 0x0, 0x0, 0x0}}}}}}, _imet_addr = {
            eth_tag = 0x0, ip_prefix_length = 0x0, ip = {ipa_type = 0x0, ip = {
                addr = 0x0, _v4_addr = {s_addr = 0x0}, _v6_addr = {__in6_u = {
                    __u6_addr8 = {0x0 <repeats 16 times>}, __u6_addr16 = {0x0,
                      0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, __u6_addr32 = {0x0,
                      0x0, 0x0, 0x0}}}}}}, _es_addr = {esi = {val = {0x0, 0x0,
                0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
---Type <return> to continue, or q <return> to quit---q
ip_prefix_length = 0x0Quit
(gdb) p/x rpf->source_nexthop.interface
$20 = 0x1013e5011300
(gdb) p/x rpf->source_nexthop.interface->info
$21 = 0x0 <======================== Pim & Igmp is disabled on this interface

Fix: Return when the rpf interface is not pim enabled

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agopimd: increase buffer size for prefix str while printing bsrp-info
saravanank [Tue, 24 Mar 2020 03:33:40 +0000 (20:33 -0700)]
pimd: increase buffer size for prefix str while printing bsrp-info

Problem: output is cut short when prefix string all octets are 3 digit.
RCA: Buffer was allocated only to hold ip addr str.

Fix: Added 3 bytes more to hold prefix length and a /.
Modified buffer in 'show ip pim bsrp-info' and 'show ip pim bsm database'

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agoMerge pull request #6026 from sarav511/nbrcln
Donald Sharp [Mon, 23 Mar 2020 23:34:15 +0000 (19:34 -0400)]
Merge pull request #6026 from sarav511/nbrcln

pimd: pimd crashes during neighbor clean up

4 years agoMerge pull request #6018 from sarav511/rp_nomatch
Donald Sharp [Mon, 23 Mar 2020 23:28:23 +0000 (19:28 -0400)]
Merge pull request #6018 from sarav511/rp_nomatch

pimd: (*, G) Prune should be processed even if the RP in packet is not RP(G)

4 years agoMerge pull request #6074 from mjstapp/fix_staticd_help_text
Donald Sharp [Mon, 23 Mar 2020 23:14:55 +0000 (19:14 -0400)]
Merge pull request #6074 from mjstapp/fix_staticd_help_text

staticd: fix vty help text

4 years agostaticd: fix vty help text
Mark Stapp [Mon, 23 Mar 2020 19:40:16 +0000 (15:40 -0400)]
staticd: fix vty help text

Missing newline in some vty help text, resulted in garbage
in help output.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #6073 from donaldsharp/is_default
Sri Mohana Singamsetty [Mon, 23 Mar 2020 17:54:33 +0000 (10:54 -0700)]
Merge pull request #6073 from donaldsharp/is_default

More `const struct prefix` work

4 years agoMerge pull request #6008 from sarav511/max_vif
Donald Sharp [Mon, 23 Mar 2020 15:28:45 +0000 (11:28 -0400)]
Merge pull request #6008 from sarav511/max_vif

pimd: Do not allow to configure multicast on more than MAXVIF interfaces

4 years agoMerge pull request #6004 from sarav511/mc_fixes
Donald Sharp [Mon, 23 Mar 2020 15:17:28 +0000 (11:17 -0400)]
Merge pull request #6004 from sarav511/mc_fixes

pimd: (S,G) Route doesn't inherit olist from parent while creation in nocache path

4 years agoMerge pull request #5851 from volta-networks/feat_ldp_oc_review
Renato Westphal [Mon, 23 Mar 2020 13:55:20 +0000 (10:55 -0300)]
Merge pull request #5851 from volta-networks/feat_ldp_oc_review

ldpd: adding support for LDP ordered label distribution control

4 years agozebra: Synchronous client queues accumulate messages from zebra.
Karen Schoener [Fri, 6 Mar 2020 15:33:40 +0000 (10:33 -0500)]
zebra: Synchronous client queues accumulate messages from zebra.

Zebra is currently sending messages on interface add/delete/update,
VRF add/delete, and interface address change - regardless of whether
its clients had requested them.  This is problematic for lde and isis,
which only listens to label chunk messages, and only when it is
waiting for one (synchronous client). The effect is the that messages
accumulate on the lde synchronous message queue.

With this change:
  - Zebra does not send unsolicited messages to synchronous clients.
  - Synchronous clients send a ZEBRA_HELLO to zebra.
    The ZEBRA_HELLO contains a new boolean field: sychronous.
  - LDP and PIM have been updated to send a ZEBRA_HELLO for their
    synchronous clients.

Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agobgpd, lib: More `const`ification of various code
Donald Sharp [Mon, 23 Mar 2020 12:41:17 +0000 (08:41 -0400)]
bgpd, lib: More `const`ification of various code

More second order effects of cleaning up rn usage
in bgp.  Sprinkle the fairy const's all over the place.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Add check for pim join, hello and assert to drop pkts without all-pim-routers...
saravanank [Mon, 16 Mar 2020 06:52:43 +0000 (23:52 -0700)]
pimd: Add check for pim join, hello and assert to drop pkts  without all-pim-routers dest.

This is as per RFC. This is identified when conformance suite catched join.

RCA:
Packets were processed without checking allowed dest IP for that packet.

Fix:
Added check for dest IP
Converted this check to a function

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agobgpd: Add some `const struct prefix` for a couple more functions
Donald Sharp [Sun, 22 Mar 2020 23:54:38 +0000 (19:54 -0400)]
bgpd: Add some `const struct prefix` for a couple more functions

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: bsr election elects wrong bsr
saravanank [Mon, 23 Mar 2020 02:40:05 +0000 (19:40 -0700)]
pimd: bsr election elects wrong bsr

RCA: preferred bsr routine, compare address in network byte order

Fix: changed to host format before comparision.

Testing:
Verified between 1.1.2.7 and 10.2.1.1, 10.2.1.1 is chosen as bsr

Initially:
R11# sh ip pim bsr
PIMv2 Bootstrap information
Current preferred BSR address: 1.1.2.7
Priority        Fragment-Tag       State           UpTime
  0               2862            ACCEPT_PREFERRED    00:00:30
Last BSM seen: 00:00:30

After next bsr started:
R11# sh ip pim bsr
PIMv2 Bootstrap information
Current preferred BSR address: 10.2.1.1
Priority        Fragment-Tag       State           UpTime
  0               3578            ACCEPT_PREFERRED    00:00:01
Last BSM seen: 00:00:01
R11# sh ip pim bsr
PIMv2 Bootstrap information
Current preferred BSR address: 10.2.1.1
Priority        Fragment-Tag       State           UpTime
  0               3578            ACCEPT_PREFERRED    00:00:04
Last BSM seen: 00:00:04

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agoMerge pull request #6070 from donaldsharp/bgp_const_struct_work
Sri Mohana Singamsetty [Mon, 23 Mar 2020 00:32:31 +0000 (17:32 -0700)]
Merge pull request #6070 from donaldsharp/bgp_const_struct_work

bgpd: More `const struct prefix` work

4 years agoMerge pull request #6051 from ton31337/fix/bool_stuff_bgp_clist
Sri Mohana Singamsetty [Mon, 23 Mar 2020 00:32:09 +0000 (17:32 -0700)]
Merge pull request #6051 from ton31337/fix/bool_stuff_bgp_clist

bgpd: Convert some community related functions to bool type

4 years agoMerge pull request #6031 from donaldsharp/debug_zebra_kernel
Sri Mohana Singamsetty [Mon, 23 Mar 2020 00:31:40 +0000 (17:31 -0700)]
Merge pull request #6031 from donaldsharp/debug_zebra_kernel

zebra: Modify some route install debugs to allow us to understand a b…

4 years agolib: Modify zclient_send_rnh to use const struct prefix
Donald Sharp [Sun, 22 Mar 2020 22:38:56 +0000 (18:38 -0400)]
lib: Modify zclient_send_rnh to use const struct prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: make is_default_host_route use a const struct prefix
Donald Sharp [Sun, 22 Mar 2020 21:14:32 +0000 (17:14 -0400)]
lib: make is_default_host_route use a const struct prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: More `const struct prefix` work
Donald Sharp [Sun, 22 Mar 2020 18:50:46 +0000 (14:50 -0400)]
bgpd: More `const struct prefix` work

Modify more code to use `const struct prefix` throughout
bgp.  This is all prep work for adding an accessor function
for bgp_node to get the prefix and reduce all the places that
code needs to be touched when we get that work done.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6067 from donaldsharp/bgp_const
Sri Mohana Singamsetty [Sun, 22 Mar 2020 18:27:03 +0000 (11:27 -0700)]
Merge pull request #6067 from donaldsharp/bgp_const

Bgp const

4 years agoMerge pull request #5825 from pguibert6WIND/nhrp_vty
Donatas Abraitis [Sun, 22 Mar 2020 12:21:42 +0000 (14:21 +0200)]
Merge pull request #5825 from pguibert6WIND/nhrp_vty

nhrpd: add json support to show nhrp vty commands

4 years agobgpd: Modify bgp_node_XXX calls to use `const struct prefix`
Donald Sharp [Sun, 22 Mar 2020 01:42:38 +0000 (21:42 -0400)]
bgpd: Modify bgp_node_XXX calls to use `const struct prefix`

Tell the compiler that the prefix is being used for lookups
and it will never change.

Setup for future work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Modify agg_XX calls to use `const struct prefix`
Donald Sharp [Sun, 22 Mar 2020 01:39:54 +0000 (21:39 -0400)]
lib: Modify agg_XX calls to use `const struct prefix`

Tell the compiler that the prefix is being used for lookups
and it will never change.

Setup for future work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6066 from donaldsharp/isis_mtu_buffer
David Lamparter [Sat, 21 Mar 2020 17:18:07 +0000 (18:18 +0100)]
Merge pull request #6066 from donaldsharp/isis_mtu_buffer

isisd: Expand send/receive buffers to allow for larger mtu

4 years agoMerge pull request #6059 from ton31337/fix/int_to_bool
Donald Sharp [Sat, 21 Mar 2020 16:39:30 +0000 (12:39 -0400)]
Merge pull request #6059 from ton31337/fix/int_to_bool

bgpd: Convert lots of int type functions to bool/void

4 years agoMerge pull request #6029 from donaldsharp/coverity_pim
Donatas Abraitis [Sat, 21 Mar 2020 13:03:28 +0000 (15:03 +0200)]
Merge pull request #6029 from donaldsharp/coverity_pim

Coverity pim

4 years agobgpd: Convert lots of int type functions to bool/void
Donatas Abraitis [Fri, 20 Mar 2020 09:57:54 +0000 (11:57 +0200)]
bgpd: Convert lots of int type functions to bool/void

Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotools: Convert type int functions to bool where possible
Donatas Abraitis [Fri, 20 Mar 2020 09:40:41 +0000 (11:40 +0200)]
tools: Convert type int functions to bool where possible

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6065 from ton31337/doc/rfc_supported_bgp
Donald Sharp [Sat, 21 Mar 2020 12:41:03 +0000 (08:41 -0400)]
Merge pull request #6065 from ton31337/doc/rfc_supported_bgp

doc: Add rfc7606 to BGP supported RFCs list

4 years agoisisd: Expand send/receive buffers to allow for larger mtu
Donald Sharp [Sat, 21 Mar 2020 12:22:51 +0000 (08:22 -0400)]
isisd: Expand send/receive buffers to allow for larger mtu

User is reporting:
2020/03/21 03:12:36 ISIS: isis_send_pdu_bcast: sock_buff size 8192 is less than output pdu size 9014 on circuit em0
2020/03/21 03:12:36 ISIS: [EC 67108865] ISIS-Adj (1): Send L2 IIH on em0 failed

MTU's can frequently hit 9k in size, we have buffer limits
that prevent this from being fully used and creating errors.

Modify the code to allow for up to 16k mtu

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6064 from opensourcerouting/topo_set_locale
Donald Sharp [Sat, 21 Mar 2020 10:29:55 +0000 (06:29 -0400)]
Merge pull request #6064 from opensourcerouting/topo_set_locale

Topotest fixes for Kernel 5.3 & locale

4 years agodoc: Add rfc7606 to BGP supported RFCs list
Donatas Abraitis [Sat, 21 Mar 2020 09:19:24 +0000 (11:19 +0200)]
doc: Add rfc7606 to BGP supported RFCs list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6023 from vivek-cumulus/strip_rts_for_vrf_route_leak
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:11:06 +0000 (18:11 -0700)]
Merge pull request #6023 from vivek-cumulus/strip_rts_for_vrf_route_leak

bgpd: Strip route targets during VRF-to-VRF route leaking

4 years agoMerge pull request #6040 from vivek-cumulus/evpn_advertise_map_allow_sets
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:10:35 +0000 (18:10 -0700)]
Merge pull request #6040 from vivek-cumulus/evpn_advertise_map_allow_sets

Allow 'sets' in EVPN advertise route-map

4 years agoMerge pull request #6060 from donaldsharp/bgp_defines_to_enum
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:10:07 +0000 (18:10 -0700)]
Merge pull request #6060 from donaldsharp/bgp_defines_to_enum

Bgp defines to enum

4 years agotests: fix check for nhid in ipv6 table output
Martin Winter [Fri, 20 Mar 2020 22:53:39 +0000 (23:53 +0100)]
tests: fix check for nhid in ipv6 table output

Check based on actual output instead of assuming output based
on kernel version

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agotests: Make topotest working on different locale
Martin Winter [Fri, 20 Mar 2020 22:50:29 +0000 (23:50 +0100)]
tests: Make topotest working on different locale

"sort" as used in all-protocol-startup used sort which causes
different sort order based on locale settings. Specify the
correct one to make output matching our expected result

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #6043 from pguibert6WIND/nhrp_clear_cache
Donald Sharp [Fri, 20 Mar 2020 22:22:51 +0000 (18:22 -0400)]
Merge pull request #6043 from pguibert6WIND/nhrp_clear_cache

nhrpd: fix clear nhrp cache dynamic entries

4 years agopimd: Prevent uninited use of tmp_oil in pim_mroute_add
Donald Sharp [Wed, 18 Mar 2020 11:42:36 +0000 (07:42 -0400)]
pimd: Prevent uninited use of tmp_oil in pim_mroute_add

There exists a path where tmp_oil is used uninited, prevent
this from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Note when rpf_update fails
Donald Sharp [Wed, 18 Mar 2020 11:41:03 +0000 (07:41 -0400)]
pimd: Note when rpf_update fails

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Ensure pointer exists before using in mlag
Donald Sharp [Wed, 18 Mar 2020 11:15:05 +0000 (07:15 -0400)]
lib: Ensure pointer exists before using in mlag

Ensure that the s pointer is valid and usable before
grabbing data off of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Prevent use after free
Donald Sharp [Wed, 18 Mar 2020 11:12:57 +0000 (07:12 -0400)]
pimd: Prevent use after free

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Modify some route install debugs to allow us to understand a bit better
Donald Sharp [Wed, 18 Mar 2020 14:31:34 +0000 (10:31 -0400)]
zebra: Modify some route install debugs to allow us to understand a bit better

1) When programming a nhg id to the kernel we had no debug of that
is what we are doing.

2) Add debugs to all nexthop information to allow us to follow
which prefix we are talking about.  This is especially
useful when dealing with a large number of routes and
you want to grep out one or two too see what is going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Convert status defines to enum
Donald Sharp [Fri, 20 Mar 2020 13:03:08 +0000 (09:03 -0400)]
bgpd: Convert status defines to enum

Convert some status defines for the fsm to an enum
so that we cannot mix and match them in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Convert #define of bgp fsm events to an enum
Donald Sharp [Fri, 20 Mar 2020 00:19:50 +0000 (20:19 -0400)]
bgpd: Convert #define of bgp fsm events to an enum

In PR #6052 which fixes issue #5963 the bgp fsm events
were confused with the bgp fsm status leading
to a bug.  Let's start separating those out
so these types of failures cannot just
easily occur.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5977 from rubenk/treewide-add-noreturn
Sri Mohana Singamsetty [Fri, 20 Mar 2020 21:55:49 +0000 (14:55 -0700)]
Merge pull request #5977 from rubenk/treewide-add-noreturn

treewide: add attribute to functions that do not return

4 years agotests: Fixing test for LDP
lynne [Thu, 20 Feb 2020 21:46:47 +0000 (16:46 -0500)]
tests: Fixing test for LDP

LDP now advertises routes it learns over an interface not configured
with LDP.  If the route, which is learned over a non-LDP configured
interface, has no other NHs learned over an interface running LDP,
the router will act as a LDP egress router.

Modifying ldp-topo1/r1/ip_mpls_route.ref to include an extra newline.
Without this newline, the ldp-topo1 was failing.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agotests: Adding test for LDP ordered label distribution control
Karen Schoener [Thu, 20 Feb 2020 19:30:25 +0000 (14:30 -0500)]
tests: Adding test for LDP ordered label distribution control

Adding test for LDP ordered label distribution control.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agoldpd: adding support for LDP ordered label distribution control
Karen Schoener [Thu, 20 Feb 2020 19:27:49 +0000 (14:27 -0500)]
ldpd: adding support for LDP ordered label distribution control

LDP ordered label distribution control only binds a label to
a FEC if it is the egress LSR, or the router received a label
binding for a FEC from the next hop router.  In this mode,
an MPLS router will create a label binding for each FEC and
distribute it to its neighbors so long as he has a entry in
the RIB for the destination.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agoMerge pull request #5971 from rubenk/ospdf-remove-workaround-for-old-openbsd
David Lamparter [Fri, 20 Mar 2020 19:55:42 +0000 (20:55 +0100)]
Merge pull request #5971 from rubenk/ospdf-remove-workaround-for-old-openbsd

ospfd: stop checking for ancient OpenBSD

4 years agoMerge pull request #6033 from rubenk/lib-do-not-use-aliased-inet-ntop-on-apple
David Lamparter [Fri, 20 Mar 2020 19:52:28 +0000 (20:52 +0100)]
Merge pull request #6033 from rubenk/lib-do-not-use-aliased-inet-ntop-on-apple

lib: cannot use aliased function on Darwin