]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
4 years agoisisd: When last area address is removed, resign if we were DR
Karen Schoener [Tue, 5 Jan 2021 21:27:32 +0000 (16:27 -0500)]
isisd: When last area address is removed, resign if we were DR

When last area address is removed, resign if we were DR.

This fixes an issue where: when the ISIS area address is changed, ISIS fails
to elect a new DR.

Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agovrrpd.yang bug fix: modify augment path to comply with rfc 7950
Bo Zhang [Sun, 3 Jan 2021 01:31:16 +0000 (17:31 -0800)]
vrrpd.yang bug fix: modify augment path to comply with rfc 7950

Signed-off-by: Bo Zhang <logbob0401@gmail.com>
4 years agoospfd: fix no show database output when selecting vrf
Louis Scalbert [Thu, 24 Dec 2020 13:41:31 +0000 (14:41 +0100)]
ospfd: fix no show database output when selecting vrf

No output when selecting a vrf
frr# show ip ospf vrf default database router adv-router 10.125.0.1
VRF Name: default

       OSPF Router with ID (10.125.0.1)

In comparison with:
frr# show ip ospf database router adv-router 10.125.0.1

       OSPF Router with ID (10.125.0.1)

                Router Link States (Area 0.0.0.0)

  LS age: 155
  Options: 0x2  : *|-|-|-|-|-|E|-
(...)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
4 years agoospf6d: ospfv3 disable on the interface, but interface prefix still shown in the...
Yash Ranjan [Tue, 1 Dec 2020 06:21:04 +0000 (22:21 -0800)]
ospf6d: ospfv3 disable on the interface, but interface prefix still shown in the output

When the ospfv3 interface is disabled by the command "no interface <eth> area <area-id>
the linked interface prefixes does not get flushed

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
4 years agoospf6d: Link LSA is not updated when router priority is modified
Mobashshera Rasool [Mon, 14 Dec 2020 07:45:47 +0000 (07:45 +0000)]
ospf6d: Link LSA is not updated when router priority is modified

Issue: #7727

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
4 years agobgpd: fix evpn route-map vni filter at origin
Chirag Shah [Thu, 10 Dec 2020 21:59:56 +0000 (13:59 -0800)]
bgpd: fix evpn route-map vni filter at origin

evpn route-map match (filter) on vni is not working
at the origin of the routes.

evpn match vni route checks for encap type as vxlan.
the source route attribute is not set with vxlan encap
thus the match filter wouldn't work.

Ticket:CM-32554
Reviewed By:CCR-11056
Testing Done:

At source have match vni plus set statement in route-map.
Validate the origin of the route's outbound correctly sets
the 'set' statment based on match vni filter.

At origin:
route-map RM-EVPN-TE-Matches permit 10
 match evpn vni 4001
  set large-community 10:10:119

Receiving end:

Route [5]:[0]:[24]:[78.41.1.0] VNI 4001
5550
  27.0.0.15 from TORS1(downlink-5) (27.0.0.15)
    Origin incomplete, metric 0, valid, external, bestpath-from-AS 5550, best (First path received)
    Extended Community: RT:5550:4001 ET:8 Rmac:00:02:00:00:00:4d
    Large Community: 10:10:119    <--- Large community stamped
    Last update: Thu Dec 10 22:19:26 2020

Signed-off-by: Chirag Shah <chirag@nvidia.com>
4 years agoMerge pull request #7877 from vishaldhingra/static_7_5
Mark Stapp [Fri, 15 Jan 2021 21:21:11 +0000 (16:21 -0500)]
Merge pull request #7877 from vishaldhingra/static_7_5

[7.5] staticd: correct table-id handling for static routes

4 years agostaticd: Backend cofiguration code to fix table-id problem
vdhingra [Fri, 15 Jan 2021 18:43:28 +0000 (10:43 -0800)]
staticd: Backend cofiguration code to fix table-id problem

problem: table-id gets overwritten for a given route.

RCA: table-id was getting overwritten from the NB layer,
     So route was getting installed with the latest table-id.

Fix: make the table-id as the key in the NB layer.
     This will program the route in zebra correctly.

- Removed the table-id modify callbacks.
- Moved the validate and apply table-id changes to path-list creation

issue #7347

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agostaticd: autogenerated code modifications due to yang changes
vdhingra [Fri, 15 Jan 2021 18:42:23 +0000 (10:42 -0800)]
staticd: autogenerated code modifications due to yang changes

updated callback methods based on autogenerated code.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agostaticd: make table-id as the key for path-list
vdhingra [Fri, 15 Jan 2021 18:41:11 +0000 (10:41 -0800)]
staticd: make table-id as the key for path-list

modified the yang model for path-list.
table-id should be a key, as one route can have
multiple table-ids.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agoMerge pull request #7778 from mjstapp/fix_rnh_default_7_5
Donatas Abraitis [Tue, 22 Dec 2020 07:25:33 +0000 (09:25 +0200)]
Merge pull request #7778 from mjstapp/fix_rnh_default_7_5

[7.5] zebra: nht resolve-via-default doesn't need force

4 years agozebra: nht resolve-via-default doesn't need force
Mark Stapp [Mon, 21 Dec 2020 15:10:40 +0000 (10:10 -0500)]
zebra: nht resolve-via-default doesn't need force

We don't need to use the 'force' flag when processing the
resolve-via-default clis for ip and ipv6: we can just do normal
nht processing. [7.5 version]

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7771 from donaldsharp/7.5_rm_fix
Donatas Abraitis [Sun, 20 Dec 2020 19:05:18 +0000 (21:05 +0200)]
Merge pull request #7771 from donaldsharp/7.5_rm_fix

[7.5]lib: Fix dependency of match types in route-map code

4 years agolib: Fix dependency of match types in route-map code
Donald Sharp [Fri, 18 Dec 2020 19:22:09 +0000 (14:22 -0500)]
lib: Fix dependency of match types in route-map code

Route-maps contain a hash of hash's that contain the
container type name ( say community or access list or whatever )
and then it has a hash of route-maps that this maps too

Suppose you have this:

!
frr version 7.3.1
frr defaults traditional
hostname eva
log stdout
!
debug route-map
!
router bgp 239
 neighbor 192.168.161.2 remote-as external
 !
 address-family ipv4 unicast
  neighbor 192.168.161.2 route-map foo in
 exit-address-family
!
bgp community-list standard 7000:40002 permit 7000:40002
bgp community-list standard 7000:40002 permit 7000:40003
!
route-map foo deny 20
 match community 7000:40002
!
route-map foo permit 10
!
line vty
!
end

You have a community hash which has an

7000:40002 entry

This entry has a hash of routemaps that are referencing it.  In this above
example it would have `foo` as the single entry.

Given the above config if you do this:

eva# conf
eva(config)# route-map foo deny 20
eva(config-route-map)# match community 7000:4003
eva(config-route-map)#

We would expect the `7000:40002` community hash to no longer have
a reference to the `foo` routemap.  Instead we see the code doing this:

2020/12/18 13:47:12 BGP: bgpd 7.3.1 starting: vty@2605, bgp@<all>:179
2020/12/18 13:47:47 BGP: Add route-map foo
2020/12/18 13:47:47 BGP: Route-map foo add sequence 10, type: permit
2020/12/18 13:47:57 BGP: Route-map foo add sequence 20, type: deny
2020/12/18 13:48:05 BGP: Adding dependency for filter 7000:40002 in route-map foo
2020/12/18 13:48:05 BGP: route_map_print_dependency: Dependency for 7000:40002: foo
2020/12/18 13:48:41 BGP: bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.161.2 in vrf default
2020/12/18 13:49:19 BGP: Deleting dependency for filter 7000:4003 in route-map foo
2020/12/18 13:49:19 BGP: Adding dependency for filter 7000:4003 in route-map foo
2020/12/18 13:49:19 BGP: route_map_print_dependency: Dependency for 7000:4003: foo

Note how the code attempts to remove the dependency for `7000:4003` instead of the
dependency for `7000:40002`.  Then we create a new hash for `7000:4003` and then
install the routemap name in it.

This is wrong.  We should remove the `7000:40002` dependency and then install
a dependency for `7000:4003`.

Fix the code to do the right thing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7710 from opensourcerouting/75-acl-compat-fix
Mark Stapp [Tue, 15 Dec 2020 17:33:10 +0000 (12:33 -0500)]
Merge pull request #7710 from opensourcerouting/75-acl-compat-fix

[7.5] lib: restore previous access/prefix list behaviour

4 years agoMerge pull request #7732 from deastoe/dplane-fpm-routes-stuck-in-queued_7.5
Russ White [Tue, 15 Dec 2020 12:20:34 +0000 (07:20 -0500)]
Merge pull request #7732 from deastoe/dplane-fpm-routes-stuck-in-queued_7.5

[7.5] Routes stuck with 'q' flag when dplane_fpm_nl is in use

4 years agoMerge pull request #7609 from wesleycoakley/apline-docker-fix-for-75
Russ White [Tue, 15 Dec 2020 12:09:09 +0000 (07:09 -0500)]
Merge pull request #7609 from wesleycoakley/apline-docker-fix-for-75

[7.5] Port Alpine / Docker build fix

4 years agozebra: routes stuck with 'q' when using dplane FPM
Duncan Eastoe [Fri, 11 Dec 2020 11:07:59 +0000 (11:07 +0000)]
zebra: routes stuck with 'q' when using dplane FPM

New work enqueued to the dplane_fpm_nl provider is initially de-queued
and re-enqueued, in fpm_nl_process(), to be processed by the provider's
own thread.

After performing this initial de-queue/enqueue we return to
dplane_thread_loop() and check the dplane_fpm_nl output queue for any
work which has been completed.

Since this work is being processed in another thread it is very likely
that there will be some (or all) work still outstanding at this point.
The dataplane thread finishes up any other tasks and then waits until
it is next scheduled. In the meantime the dplane_fpm_nl thread is
processing its work queue until completion.

The issue arises here as the dataplane thread is not explicitly
re-scheduled once dplane_fpm_nl has drained its work queue and
populated its output queue with completed work.

This completed work can sit in the output queue for an indeterminate
period of time, depending upon when the dataplane thread is next
scheduled for other work. If the RIB has reached a stable state then
this could be a significant period of time. During this period zebra
marks these routes as queued, even though they have actually been
processed by all dataplane providers.

An un-related RIB change which triggers a FIB update will result in
the dataplane thread being scheduled and this completed work then
being processed. At this point the routes will then no longer be
marked as queued by zebra. However this new FIB update might itself
then fall victim to the same scenario!

We can observe the above behaviour in these detailed dplane logs.

    11:24:47 zebra[7282]: dplane: incoming new work counter: 2
    11:24:47 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:24:47 zebra[7282]: dplane provider 'Kernel': processing
    11:24:47 zebra[7282]: Dplane NEIGH_DISCOVER, ip 192.168.2.2, ifindex 9
    11:24:47 zebra[7282]: Dplane NEIGH_DISCOVER, ip 192.168.2.2, ifindex 9
    11:24:47 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:24:47 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:24:47 zebra[7282]: dplane dequeues 1 completed work from provider dplane_fpm_nl
    11:24:47 zebra[7282]: dplane has 1 completed, 0 errors, for zebra main

2 contexts (all incoming work) have been queued to dplane_fpm_nl - all good.
1 completed context was de-queued, so there is outstanding work.

    11:24:58 zebra[7282]: dplane: incoming new work counter: 2
    11:24:58 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:24:58 zebra[7282]: dplane provider 'Kernel': processing
    11:24:58 zebra[7282]: ID (193) Dplane nexthop update ctx 0x55c429b6fed0 op NH_INSTALL
    11:24:58 zebra[7282]: 0:5.5.5.5/32 Dplane route update ctx 0x55c429b79690 op ROUTE_INSTALL
    11:24:58 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:24:58 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:24:58 zebra[7282]: dplane dequeues 2 completed work from provider dplane_fpm_nl
    11:24:58 zebra[7282]: dplane has 2 completed, 0 errors, for zebra main

A further 2 contexts (all incoming work) have been queued to dplane_fpm_nl - all good.
2 completed contexts were de-queued, which sounds good as that is what we en-queued.
However, there is an outstanding context from earlier, so there is still outstanding
work.

Indeed the new 5.5.5.5/32 route is marked as queued:

    O>q 5.5.5.5/32 [110/10] via 192.168.2.2, dp0p1s3, weight 1, 00:01:19

This remains the case until we trigger a FIB update by installation of the
(eg.) 10.10.10.10/32 route:

    11:26:41 zebra[7282]: dplane: incoming new work counter: 2
    11:26:41 zebra[7282]: dplane enqueues 2 new work to provider 'Kernel'
    11:26:41 zebra[7282]: dplane provider 'Kernel': processing
    11:26:41 zebra[7282]: ID (195) Dplane nexthop update ctx 0x55c429b78ce0 op NH_INSTALL
    11:26:41 zebra[7282]: 0:10.10.10.10/32 Dplane route update ctx 0x55c429b7a040 op ROUTE_INSTALL
    11:26:41 zebra[7282]: dplane dequeues 2 completed work from provider Kernel
    11:26:41 zebra[7282]: dplane enqueues 2 new work to provider 'dplane_fpm_nl'
    11:26:41 zebra[7282]: dplane dequeues 2 completed work from provider dplane_fpm_nl
    11:26:41 zebra[7282]: dplane has 2 completed, 0 errors, for zebra main
    11:26:41 zebra[7282]: zebra2proto: Please add this protocol(2) to proper rt_netlink.c handling
    11:26:41 zebra[7282]: Nexthop dplane ctx 0x55c429b6fed0, op NH_INSTALL, nexthop ID (193), result SUCCESS
    11:26:41 zebra[7282]: default(0:254):5.5.5.5/32 Processing dplane result ctx 0x55c429b79690, op ROUTE_INSTALL result SUCCESS

We observe the same 2 enqueues and 2 dequeues as before, which again suggests
that there is outstanding work.

As expected, the 5.5.5.5/32 route is no longer marked as queued:

    O>* 5.5.5.5/32 [110/10] via 192.168.2.2, dp0p1s3, weight 1, 00:02:06

But the 10.10.10.10/32 route is, as we have not yet processed the completed
context:

    C>q 10.10.10.10/32 is directly connected, lo, 00:26:05

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
(cherry picked from commit 164d8e86081fdf33992b6c45af446bac6103e20c)

4 years agozebra: dplane API to get provider output q length
Duncan Eastoe [Fri, 11 Dec 2020 11:03:53 +0000 (11:03 +0000)]
zebra: dplane API to get provider output q length

Returns the current number of (completed) contexts in the provider's
output queue (dp_ctx_out_q), allowing access to this data from the
provider itself.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
(cherry picked from commit 53706b4e5114e18a68ad3ab2a4cd9ca9433e4cb2)

4 years agodplane_fpm_nl: queue peak counter never increments
Duncan Eastoe [Fri, 11 Dec 2020 10:26:54 +0000 (10:26 +0000)]
dplane_fpm_nl: queue peak counter never increments

The context queue length peak counter is always set to its current
value, hence never increments.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
(cherry picked from commit 7545bda0a4b0114c6d73552fdbdce016f58572c0)

4 years agoMerge pull request #7714 from ranjanyash54/2371_7.5
Donald Sharp [Sat, 12 Dec 2020 01:59:12 +0000 (20:59 -0500)]
Merge pull request #7714 from ranjanyash54/2371_7.5

ospf6d: [7.5]Fix the prefix walking for show database command for intra-prefix and link

4 years agoMerge pull request #7715 from idryzhov/7.5-backports-again
Donald Sharp [Sat, 12 Dec 2020 01:41:01 +0000 (20:41 -0500)]
Merge pull request #7715 from idryzhov/7.5-backports-again

7.5 backports

4 years agozebra: anticipate zns creation at vrf creation when backend is vrf-lite
Philippe Guibert [Tue, 8 Dec 2020 11:11:05 +0000 (11:11 +0000)]
zebra: anticipate zns creation at vrf creation when backend is vrf-lite

in the case the namespace pointer is already available, feed it at vrf
creation. this prevents from crashing if the netlink parsing already
began, and the vrf-lite is not enabled yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobgpd: local routes use non-default distance
Chirag Shah [Wed, 9 Dec 2020 05:04:50 +0000 (21:04 -0800)]
bgpd: local routes use non-default distance

Use user provided AD for local routes (aggregate).

 address-family ipv4 unicast
  distance bgp 20 200 210
  network 47.2.2.8/30
  aggregate-address 51.1.0.0/16

Testing Done:

Before aggr route uses default 200 AD even user provided local AD.
B>* 51.1.0.0/16 [200/0] unreachable (blackhole), weight 1, 00:01:14

After:
B>* 51.1.0.0/16 [210/0] unreachable (blackhole), weight 1, 00:00:01

Signed-off-by: Chirag Shah <chirag@nvidia.com>
4 years agoospf6d: Fix for "show ipv6 ospf6 database link"
Yash Ranjan [Fri, 11 Dec 2020 05:19:55 +0000 (21:19 -0800)]
ospf6d: Fix for "show ipv6 ospf6 database link"

Some prefixes were not shown in the link database
show command, due to issues with pointer calculation.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
4 years agoospf6d: Fix for "show ipv6 ospf6 database intra-prefix"
Yash Ranjan [Fri, 11 Dec 2020 05:16:37 +0000 (21:16 -0800)]
ospf6d: Fix for "show ipv6 ospf6 database intra-prefix"

Some prefixes were not shown in the intra-prefix database
show command, due to issues with pointer calculation.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
4 years agolib: prevent libyang abstraction memory leak
Rafael Zalamena [Wed, 9 Dec 2020 12:57:28 +0000 (09:57 -0300)]
lib: prevent libyang abstraction memory leak

Call `ly_set_free()` on `YANG_ITER_STOP` as well.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 4e32d023cdf9fc5326b09ea6aa16d465bc948147)

4 years agolib: silently ignore duplicated values
Rafael Zalamena [Mon, 7 Dec 2020 15:10:42 +0000 (12:10 -0300)]
lib: silently ignore duplicated values

Keep the previous CLI behavior of silently ignoring access lists which
contain the same value.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 866f48f2df2e9de260080f31edbde9f17622fc03)

4 years agolib: disallow prefix list duplicated values
Rafael Zalamena [Mon, 7 Dec 2020 15:08:44 +0000 (12:08 -0300)]
lib: disallow prefix list duplicated values

Don't allow users to create multiple entries in the same list with the
same value to keep the behavior previously to northbound migration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 54d153f7864c8197d883cbaafe55bddf940a6db0)

4 years agolib: silently ignore duplicated values
Rafael Zalamena [Fri, 4 Dec 2020 21:12:58 +0000 (18:12 -0300)]
lib: silently ignore duplicated values

Keep the previous CLI behavior of silently ignoring access lists which
contain the same value.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 208dc372cd1069ab0a9efee2815b04481934f856)

4 years agolib: disallow access list duplicated values
Rafael Zalamena [Fri, 4 Dec 2020 21:11:45 +0000 (18:11 -0300)]
lib: disallow access list duplicated values

Don't allow users to create multiple rules in the same list with the
same value to keep the behavior previously to northbound migration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit f414129b0ce109550bd3a61f6020d7a9af6f9c35)

4 years agoMerge pull request #7701 from mjstapp/fix_ospfd_finish_sa_7_5
Donald Sharp [Wed, 9 Dec 2020 21:47:54 +0000 (16:47 -0500)]
Merge pull request #7701 from mjstapp/fix_ospfd_finish_sa_7_5

ospfd: clean up SA (7.5 version)

4 years agoisisd: fix null pointer dereference when parsing LSP
Renato Westphal [Thu, 3 Dec 2020 15:19:06 +0000 (12:19 -0300)]
isisd: fix null pointer dereference when parsing LSP

In some extraordinary circumstances an LSP might not have any
TLV. Add a null check to prevent a crash when that happens.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agofrr-reload: ignore-case in the es-id and es-sys-mac config comparisons
Anuradha Karuppiah [Thu, 19 Nov 2020 22:15:44 +0000 (14:15 -0800)]
frr-reload: ignore-case in the es-id and es-sys-mac config comparisons

MAC address can be configured as lower/upper hex characters but is
always rendered as lower case in "show run". Avoid incorrect "change
detection" by ignoring case.

Ticket: CM-32235

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
4 years agofrr-reload: fixup ipv6 address normalization
Anuradha Karuppiah [Thu, 19 Nov 2020 19:59:35 +0000 (11:59 -0800)]
frr-reload: fixup ipv6 address normalization

The condition to normalize ipv6 addresses was accidentally broken via -
[
e238920df07be0b61e483f0a58e0b99ab3d2e0ea tools: Fix reload with 'ipv6 address...' in interface
]

The condition was supposed to be skipped only if "ipv6 add" was present
in the line.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 years agobgpd: Let's actually track if the nh was updated
Donald Sharp [Fri, 4 Dec 2020 13:01:31 +0000 (08:01 -0500)]
bgpd: Let's actually track if the nh was updated

In bgp_zebra_announce when iterating over multipath
we were checking to ensure that the nexthop was updated
but never initially clearing the nh_updated variable.
Thus leading to a situation where we could crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoospfd: Restore POINTOMULTIPOINT to working order
Donald Sharp [Sat, 28 Nov 2020 20:35:18 +0000 (15:35 -0500)]
ospfd: Restore POINTOMULTIPOINT to working order

Commit: 1d376ff539508f336cb5872c5592b780e3db180b removed
the code to find nexthops for the POINTOMULTIPOINT and
replaced it with a generic bit of code that was
supposed to handle both POINTOPOINT and POINTOMULTIPOINT
the problem is that the ospf rfc states that the
network mask on point to multipoint should be /32
which will not allow you to properly do a prefix match
on it against the network.

Restore original behavior as much as possible and leave
the new POINTOPOINT code alone.

Fixes: #7624
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoospfd: Set Curr_mtu to when we get the mtu
Donald Sharp [Tue, 1 Dec 2020 20:37:03 +0000 (15:37 -0500)]
ospfd: Set Curr_mtu to when we get the mtu

Currently if you start ospfd, bring up neighbors and then issue
a tcpdump on a interface ospf is peering over, this causes the neighbor
relationship to be restarted:

root@spectrum301(mlx-4600c-01):mgmt:~# tcpdump -i vlan402
2020-11-13T21:25:38.059671+00:00 spectrum301 ospfd[29953]: AdjChg: Nbr 202.0.0.3(default) on vlan402:200.0.3.1: Full -> Deleted (KillNbr)
2020-11-13T21:25:38.065520+00:00 spectrum301 ospfd[29953]: ospfTrapNbrStateChange: trap sent: 200.0.3.2 now Deleted/DROther
2020-11-13T21:25:38.065922+00:00 spectrum301 ospfd[29953]: ospfTrapIfStateChange: trap sent: 200.0.3.1 now Down
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vlan402, link-type EN10MB (Ethernet), capture size 262144 bytes
21:25:38.072330 IP 200.0.3.1 > igmp.mcast.net: igmp v3 report, 1 group record(s)
2020-11-13T21:25:38.080430+00:00 spectrum301 ospfd[29953]: ospfTrapIfStateChange: trap sent: 200.0.3.1 now Point-To-Point
2020-11-13T21:25:38.080654+00:00 spectrum301 ospfd[29953]: SPF Processing Time(usecs): 9734
2020-11-13T21:25:38.080829+00:00 spectrum301 ospfd[29953]:             SPF Time: 6422
2020-11-13T21:25:38.080991+00:00 spectrum301 ospfd[29953]:            InterArea: 1572
2020-11-13T21:25:38.081152+00:00 spectrum301 ospfd[29953]:                Prune: 67
2020-11-13T21:25:38.081329+00:00 spectrum301 ospfd[29953]:         RouteInstall: 1396
2020-11-13T21:25:38.081548+00:00 spectrum301 ospfd[29953]: Reason(s) for SPF: N, S, ABR, ASBR
21:25:38.092510 IP 200.0.3.1 > ospf-all.mcast.net: OSPFv2, Hello, length 44

This is happening because the curr_mtu is not being properly stored.  It was being set
on interface creation( but we have not actually read in the mtu part of the interface data, so
it is still 0 ).

Modify the code to store the curr_mtu at a point in interface creation *After* we have read
in interface data.

Ticket: CM-32276
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agozebra: fix show ip route vrf X summary
Emanuele Di Pascale [Tue, 1 Dec 2020 17:24:46 +0000 (18:24 +0100)]
zebra: fix show ip route vrf X summary

The lookup for non default VRFs was always using a tableId; if not
provided, we were defaulting to RT_TABLE_MAIN. This is fine for the
default VRF but not for others. As a result, the command was silently
failing for non-default VRFs unless we also specified the correct tableId.

Fix this by only performing the lookup using the tableId if it is
provided; else use zebra_vrf_table.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoMerge pull request #7698 from mjstapp/fix_zebra_writen_7_5
Donald Sharp [Wed, 9 Dec 2020 19:19:58 +0000 (14:19 -0500)]
Merge pull request #7698 from mjstapp/fix_zebra_writen_7_5

zebra: [7.5] use zserv_send_message instead of writen

4 years agoospfd: clean up SA (7.5 version)
Mark Stapp [Wed, 9 Dec 2020 17:31:41 +0000 (12:31 -0500)]
ospfd: clean up SA (7.5 version)

Clean up a dead initialization in ospf_finish_final().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agozebra: use zserv_send_message instead of writen
Mark Stapp [Wed, 9 Dec 2020 14:17:25 +0000 (09:17 -0500)]
zebra: use zserv_send_message instead of writen

Following functions is using writen to dispatch message
into socket, but another function uses zserv_send_message.
This commit does tiny unification for zapi's socket messaging.

Funcs:
- zsend_assign_label_chunk_response()
- zsend_label_manager_connect_response()

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7672 from idryzhov/7.5-bfd-fix-session-lookup
Rafael Zalamena [Mon, 7 Dec 2020 13:09:46 +0000 (10:09 -0300)]
Merge pull request #7672 from idryzhov/7.5-bfd-fix-session-lookup

[7.5] bfd: fix session lookup

4 years agobfd: fix session lookup
Igor Ryzhov [Fri, 4 Dec 2020 11:37:36 +0000 (14:37 +0300)]
bfd: fix session lookup

local-address is optional for both IPv4 and IPv6.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7654 from idryzhov/7.5-ospf-init-instance
Donald Sharp [Wed, 2 Dec 2020 13:53:53 +0000 (08:53 -0500)]
Merge pull request #7654 from idryzhov/7.5-ospf-init-instance

[7.5] ospf: fix instance initialization when using multi-instance mode

4 years agoospf: fix instance initialization when using multi-instance mode
Igor Ryzhov [Wed, 2 Dec 2020 00:36:10 +0000 (03:36 +0300)]
ospf: fix instance initialization when using multi-instance mode

OSPF instance initialization was moved from "router ospf" vty command to
ospf_get function some time ago but the same thing must be done in
ospf_get_instance function used when multi-instance mode is enabled.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7616 from idryzhov/more-7.5-backports
Donald Sharp [Mon, 30 Nov 2020 12:48:41 +0000 (07:48 -0500)]
Merge pull request #7616 from idryzhov/more-7.5-backports

[7.5] backport fixes

4 years agoMerge pull request #7622 from idryzhov/7.5-fix-cisco-access-list
Rafael Zalamena [Mon, 30 Nov 2020 12:17:19 +0000 (09:17 -0300)]
Merge pull request #7622 from idryzhov/7.5-fix-cisco-access-list

[7.5] yang: fix cisco access list source value

4 years agoyang: fix cisco access list source value
Igor Ryzhov [Fri, 27 Nov 2020 18:53:25 +0000 (21:53 +0300)]
yang: fix cisco access list source value

Source value must be a choice between host, network and any, not a set
of all three.

Fixes #7599.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoldpd: Prevent usage after free
Donald Sharp [Thu, 26 Nov 2020 23:23:57 +0000 (18:23 -0500)]
ldpd: Prevent usage after free

error 26-Nov-2020 14:35:02 ERROR: AddressSanitizer: heap-use-after-free on address 0x631000024838 at pc 0x55cefae977e9 bp 0x7ffdd3546860 sp 0x7ffdd3546850
error 26-Nov-2020 14:35:02 READ of size 4 at 0x631000024838 thread T0
error 26-Nov-2020 14:35:02     #0 0x55cefae977e8 in ldpe_imsg_compose_parent_sync ldpd/ldpe.c:256
error 26-Nov-2020 14:35:02     #1 0x55cefae9ab13 in vlog ldpd/log.c:53
error 26-Nov-2020 14:35:02     #2 0x55cefae9b21f in log_info ldpd/log.c:102
error 26-Nov-2020 14:35:02     #3 0x55cefae96eae in ldpe_shutdown ldpd/ldpe.c:237
error 26-Nov-2020 14:35:02     #4 0x55cefae99254 in ldpe_dispatch_main ldpd/ldpe.c:585
error 26-Nov-2020 14:35:02     #5 0x55cefaf93875 in thread_call lib/thread.c:1681
error 26-Nov-2020 14:35:02     #6 0x55cefae97304 in ldpe ldpd/ldpe.c:136
error 26-Nov-2020 14:35:02     #7 0x55cefae5a2e2 in main ldpd/ldpd.c:322
error 26-Nov-2020 14:35:02     #8 0x7f4ef0c33b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
error 26-Nov-2020 14:35:02     #9 0x55cefae525e9 in _start (/usr/lib/frr/ldpd+0xb35e9)
error 26-Nov-2020 14:35:02
error 26-Nov-2020 14:35:02 0x631000024838 is located 65592 bytes inside of 65632-byte region [0x631000014800,0x631000024860)
error 26-Nov-2020 14:35:02 freed by thread T0 here:
error 26-Nov-2020 14:35:02     #0 0x7f4ef21e37a8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8)
error 26-Nov-2020 14:35:02     #1 0x55cefae96e91 in ldpe_shutdown ldpd/ldpe.c:234
error 26-Nov-2020 14:35:02     #2 0x55cefae99254 in ldpe_dispatch_main ldpd/ldpe.c:585
error 26-Nov-2020 14:35:02     #3 0x55cefaf93875 in thread_call lib/thread.c:1681
error 26-Nov-2020 14:35:02     #4 0x55cefae97304 in ldpe ldpd/ldpe.c:136
error 26-Nov-2020 14:35:02     #5 0x55cefae5a2e2 in main ldpd/ldpd.c:322
error 26-Nov-2020 14:35:02     #6 0x7f4ef0c33b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
error 26-Nov-2020 14:35:02
error 26-Nov-2020 14:35:02 previously allocated by thread T0 here:
error 26-Nov-2020 14:35:02     #0 0x7f4ef21e3d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
error 26-Nov-2020 14:35:02     #1 0x55cefae9725d in ldpe ldpd/ldpe.c:127
error 26-Nov-2020 14:35:02     #2 0x55cefae5a2e2 in main ldpd/ldpd.c:322
error 26-Nov-2020 14:35:02     #3 0x7f4ef0c33b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Clean this problem up in the same way as the previous commit

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoldpd: Prevent usage after free
Donald Sharp [Wed, 25 Nov 2020 12:36:43 +0000 (07:36 -0500)]
ldpd: Prevent usage after free

We are using data after it has been freed and handed back to the
OS.
Address Sanitizer output:

error 23-Nov-2020 18:53:57 ERROR: AddressSanitizer: heap-use-after-free on address 0x631000024838 at pc 0x55f825998f58 bp 0x7fffa5b0f5b0 sp 0x7fffa5b0f5a0
error 23-Nov-2020 18:53:57 READ of size 4 at 0x631000024838 thread T0
error 23-Nov-2020 18:53:57     #0 0x55f825998f57 in lde_imsg_compose_parent_sync ldpd/lde.c:226
error 23-Nov-2020 18:53:57     #1 0x55f8259ca9ed in vlog ldpd/log.c:48
error 23-Nov-2020 18:53:57     #2 0x55f8259cb1c8 in log_info ldpd/log.c:102
error 23-Nov-2020 18:53:57     #3 0x55f82599e841 in lde_shutdown ldpd/lde.c:208
error 23-Nov-2020 18:53:57     #4 0x55f8259a2703 in lde_dispatch_parent ldpd/lde.c:666
error 23-Nov-2020 18:53:57     #5 0x55f825ac3815 in thread_call lib/thread.c:1681
error 23-Nov-2020 18:53:57     #6 0x55f825998d5e in lde ldpd/lde.c:160
error 23-Nov-2020 18:53:57     #7 0x55f82598a289 in main ldpd/ldpd.c:320
error 23-Nov-2020 18:53:57     #8 0x7fe3f749db96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
error 23-Nov-2020 18:53:57     #9 0x55f825982579 in _start (/usr/lib/frr/ldpd+0xb3579)
error 23-Nov-2020 18:53:57
error 23-Nov-2020 18:53:57 0x631000024838 is located 65592 bytes inside of 65632-byte region [0x631000014800,0x631000024860)
error 23-Nov-2020 18:53:57 freed by thread T0 here:
error 23-Nov-2020 18:53:57     #0 0x7fe3f8a4d7a8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8)
error 23-Nov-2020 18:53:57     #1 0x55f82599e830 in lde_shutdown ldpd/lde.c:206
error 23-Nov-2020 18:53:57     #2 0x55f8259a2703 in lde_dispatch_parent ldpd/lde.c:666
error 23-Nov-2020 18:53:57     #3 0x55f825ac3815 in thread_call lib/thread.c:1681
error 23-Nov-2020 18:53:57     #4 0x55f825998d5e in lde ldpd/lde.c:160
error 23-Nov-2020 18:53:57     #5 0x55f82598a289 in main ldpd/ldpd.c:320
error 23-Nov-2020 18:53:57     #6 0x7fe3f749db96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
error 23-Nov-2020 18:53:57
error 23-Nov-2020 18:53:57 previously allocated by thread T0 here:
error 23-Nov-2020 18:53:57     #0 0x7fe3f8a4dd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
error 23-Nov-2020 18:53:57     #1 0x55f825998cb7 in lde ldpd/lde.c:151
error 23-Nov-2020 18:53:57     #2 0x55f82598a289 in main ldpd/ldpd.c:320
error 23-Nov-2020 18:53:57     #3 0x7fe3f749db96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
error 23-Nov-2020 18:53:57

The fix is to put this in global space.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoisisd: check vertex type before checking its data
Renato Westphal [Fri, 20 Nov 2020 22:26:45 +0000 (19:26 -0300)]
isisd: check vertex type before checking its data

vertex->N is an union whose "id" and "ip" fields are only valid
depending on the vertex type (IS adjacency or IP reachability
information). As such, add a vertex type check before consulting
vertex->N.id in order to prevent unexpected behavior from happening.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoisisd: fix some crashes with --tcli
Renato Westphal [Fri, 6 Nov 2020 13:02:16 +0000 (10:02 -0300)]
isisd: fix some crashes with --tcli

The "ifp" variable returned by nb_running_get_entry() might be
NULL when using the transactional CLI mode. Make the required
modifications to avoid null pointer dereferences.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgpd: sh running config is not considering values provided via -e for max-paths
vdhingra [Thu, 19 Nov 2020 12:46:39 +0000 (04:46 -0800)]
bgpd: sh running config is not considering values provided via -e for max-paths

problem
1. run the bgp with -e1 option
2. c t
   router bgp 100
3. show running config
    !
     address-family ipv6 multicast
      maximum-paths 1
      maximum-paths ibgp 1
     exit-address-family
    !
address families should not dump maximum-paths if there
value is same as value provided at run time.

fix
if the maxpaths_ebgp value is same as multipath_num global
object, don't dump maximum-paths.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agoospfd: fix NSSA translate-always
ckishimo [Fri, 20 Nov 2020 21:53:20 +0000 (13:53 -0800)]
ospfd: fix NSSA translate-always

When an ABR NSSA router is configured to be ALWAYS the translator:
  r22(config-router)# area 1 nssa translate-always

It will advertise this condition in the type-1 LSA setting the Nt
bit, taking over the translator role from r33

  r22# show ip ospf
     We are an ABR and always an NSSA Translator.
  r33# show ip ospf
     We are an ABR, but not the NSSA Elected Translator.

However when the command above is removed:
  r22(config-router)# no area 1 nssa translate-always

the bit Nt needs to be cleared otherwise we end up with no translator
in the area
  r22# show ip ospf
     We are an ABR, but not the NSSA Elected Translator.
  r33# show ip ospf
     We are an ABR, but not the NSSA Elected Translator.

This PR forces the ABR to send a type-1 LSA with the Nt bit updated
according to the translator role

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoospfd: fix NSSA translator
ckishimo [Thu, 19 Nov 2020 07:23:14 +0000 (23:23 -0800)]
ospfd: fix NSSA translator

Having 2 ABR in NSSA area where R3 is the elected translator

R3# show ip ospf
  We are an ABR and the NSSA Elected Translator.
R2# show ip ospf
  We are an ABR, but not the NSSA Elected Translator.

When R3 loses the Border condition by shutting down the interface
to the backbone, we end up with no translator in the NSSA area. It
is expected R2 to take over the translator role

R3# sh ip ospf
  It is not ABR, therefore not Translator.
R2# show ip ospf
   We are an ABR, but not the NSSA Elected Translator.

This PR forces the ABR to reevaluate the translator condition, so
R2 becomes the elected Translator

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoospf6d: More lists being leaked
Donald Sharp [Thu, 19 Nov 2020 13:04:51 +0000 (08:04 -0500)]
ospf6d: More lists being leaked

Apparently the person who wrote this code was big into
cut-n-paste.  Commit 710a61d57c8f1b0ea66a37f09bad2161d7e2ddb7
found the first instance, but upon code inspection this morning
it became evident that 2 other functions had the exact same
problem.

Fix.  Note I have not cleaned up the cut-n-paste code for
two reasons: a) I'm chasing something else b) this code
has been fairly un-maintained for a very long time.  No
need to start up now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobfdd: fix multiple links same address
Rafael Zalamena [Wed, 18 Nov 2020 18:47:00 +0000 (15:47 -0300)]
bfdd: fix multiple links same address

Allows users with multiple links using same IPv6 address (same VRF) to
work.

Reported-by: Matti Suuronen
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobgpd: Prevent ecommunity_ecom2str memory leak
Donald Sharp [Wed, 18 Nov 2020 17:50:48 +0000 (12:50 -0500)]
bgpd: Prevent ecommunity_ecom2str memory leak

We were allocating but never freeing memory associated with the
ecommunity_ecom2str allocation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobgpd: Do not leak vname if we find the match
Donald Sharp [Wed, 18 Nov 2020 17:10:22 +0000 (12:10 -0500)]
bgpd: Do not leak vname if we find the match

If we are attempting to store the bgp name for route
leaking and we find a match do not leak the memory.

Please note this is probably not really going to happen
ever.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoospf6d: Free up list memory
Donald Sharp [Wed, 18 Nov 2020 16:42:50 +0000 (11:42 -0500)]
ospf6d: Free up list memory

OSPFv3 snmp code creates a list but never deletes the actual
list.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agopimd: A buffer may be used uninited
Donald Sharp [Wed, 18 Nov 2020 16:42:06 +0000 (11:42 -0500)]
pimd: A buffer may be used uninited

If we screw up and don't have the right flags we'll print
out garbage.  At the very least just print out nothing.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
4 years agotools: fix frr-reload l2vpn delete
Emanuele Di Pascale [Wed, 11 Nov 2020 16:29:15 +0000 (17:29 +0100)]
tools: fix frr-reload l2vpn delete

when deleting a whole l2vpn context in ldpd which also had pseudowires
in it, we were first deleting the l2vpn with a 'no l2vpn XXX' command,
and then adding it again by running 'l2vpn XXX\n no member pseudowire YYY'
which obviously was not needed. As a result the l2vpn would be reinstated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoisisd: fix uninitialized variable
Igor Ryzhov [Wed, 18 Nov 2020 16:07:49 +0000 (19:07 +0300)]
isisd: fix uninitialized variable

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agozebra: fix writing to pointer instead of value
Igor Ryzhov [Wed, 18 Nov 2020 16:05:30 +0000 (19:05 +0300)]
zebra: fix writing to pointer instead of value

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: Cleanup mem-leaks in error case
Donald Sharp [Wed, 18 Nov 2020 13:54:51 +0000 (08:54 -0500)]
lib: Cleanup mem-leaks in error case

When we fail to properly lookup an error code, properly cleanup
on return.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7605 from donaldsharp/75_ospf_crash_fix
Donatas Abraitis [Thu, 26 Nov 2020 12:53:29 +0000 (14:53 +0200)]
Merge pull request #7605 from donaldsharp/75_ospf_crash_fix

[7.5]ospfd: Prevent crash by accessing memory not owned.

4 years agoalpine: Remove old docker deps for alpine
Wesley Coakley [Thu, 22 Oct 2020 06:57:38 +0000 (02:57 -0400)]
alpine: Remove old docker deps for alpine

Remove py-ipaddr and ipsec-tools as deps in the Alpine build container,
as these were both Python 2 libraries and are not used here anymore

`ipsec-tools` is also no longer available in Alpine's test repos and was
causing breakage on this builder

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
4 years agoospfd: Prevent crash by accessing memory not owned.
Donald Sharp [Wed, 25 Nov 2020 14:49:28 +0000 (09:49 -0500)]
ospfd: Prevent crash by accessing memory not owned.

When allocating memory for the `struct ospf_metric` we
were using `uint32_t` instead of the actual size of this
structure.  When we wrote to it we would be writing
into other people's memory.

Found-by: Amol Lad
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7575 from idryzhov/7.5-fix-quit
Donald Sharp [Fri, 20 Nov 2020 18:01:13 +0000 (13:01 -0500)]
Merge pull request #7575 from idryzhov/7.5-fix-quit

[7.5] vtysh: send quit command to watchfrr

4 years agovtysh: send quit command to watchfrr
Igor Ryzhov [Fri, 20 Nov 2020 14:42:39 +0000 (17:42 +0300)]
vtysh: send quit command to watchfrr

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7542 from idryzhov/7.5-bp
Donald Sharp [Wed, 18 Nov 2020 20:26:54 +0000 (15:26 -0500)]
Merge pull request #7542 from idryzhov/7.5-bp

[7.5] backport recent fixes

4 years agoMerge pull request #7547 from idryzhov/debian-revision
Donatas Abraitis [Wed, 18 Nov 2020 06:30:14 +0000 (08:30 +0200)]
Merge pull request #7547 from idryzhov/debian-revision

[7.5] changelog: add debian revision

4 years agochangelog: add debian revision
Igor Ryzhov [Tue, 17 Nov 2020 18:21:09 +0000 (21:21 +0300)]
changelog: add debian revision

It is optional, but lintian complains when a package mixes versions with
and without revision number. All previous versions have it so 7.5 should
have it too.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: notify BFD when adding new profile
Rafael Zalamena [Sun, 4 Oct 2020 21:04:27 +0000 (18:04 -0300)]
lib: notify BFD when adding new profile

When a BFD integrated session already exists setting the profile
doesn't cause a session update (or vice versa): fix this issue by
handling the other cases.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoospfd: reset mpls-te prior to ospf router removal
Carlo Galiotto [Fri, 13 Nov 2020 16:35:06 +0000 (17:35 +0100)]
ospfd: reset mpls-te prior to ospf router removal

This commits attempts to fix a problem that occurs when mpls-te gets
removed from ospfd config. Mpls-te has an inter-as option, which can be
set to Off/Area/AS. Whenever the inter-as takes "Area" or "AS" as a
value, this value will not be cleaned after removing mpls-te or after
removing the ospf router. Therefore, if mpls-te is configured with
inter-as AS or Area and we remove mpls-te or the ospf router, the
inter-as will still preserve its value; therefore, next time mpls-te is
enabled, it will automatically inherits the previous inter-as value
(either Area or AS). This leads to wrong configuration, which can be a
problem for frr_reload.py.
The commits forces mpls-te to reset inter-as to Off before it mpls-te
gets removed from the configuration and before the ospf router gets
removed.

Signed-off-by: Carlo Galiotto <carlo@voltanet.io>
4 years agolib: When aborting log data
Donald Sharp [Mon, 16 Nov 2020 20:12:43 +0000 (15:12 -0500)]
lib: When aborting log data

When a FRR process dies due to SIGILL/SIGABORT/etc attempt
to drain the log buffer.  This code change is capturing
some missing logs that were not part of the log file on
a crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobabeld: Free ifc leak
Donald Sharp [Sun, 15 Nov 2020 02:19:42 +0000 (21:19 -0500)]
babeld: Free ifc leak

On removal of an address on an interface babel was not properly
cleaning memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoisisd: Free created tables
Donald Sharp [Sat, 14 Nov 2020 22:58:40 +0000 (17:58 -0500)]
isisd: Free created tables

On redistribution into isis we were creating a table for
handling the redistributed routes, but never cleaning them
up on shutdown properly.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobgpd: on debug esi was not properly setup
Donald Sharp [Sat, 14 Nov 2020 22:33:43 +0000 (17:33 -0500)]
bgpd: on debug esi was not properly setup

There exists a code path where the esi would be passed
to a debug without the esi being setup with any values
causing us to display what ever is on the stack.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoisisd: On shutdown leaking spf_timer thread data
Donald Sharp [Sat, 14 Nov 2020 22:32:01 +0000 (17:32 -0500)]
isisd: On shutdown leaking spf_timer thread data

When isis is being shutdown the area->spf_timer thread has
special data assigned to that was never being freed.
Free this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobfdd: On interface address delete we are leaking memory
Donald Sharp [Sat, 14 Nov 2020 22:31:21 +0000 (17:31 -0500)]
bfdd: On interface address delete we are leaking memory

The interface address delete callback from zebra was not
deleting the ifc that was created as per normal work methodologies

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobgpd: When showing a lcommunity free alloced memory
Donald Sharp [Sat, 14 Nov 2020 21:29:16 +0000 (16:29 -0500)]
bgpd: When showing a lcommunity free alloced memory

We are temporarily allocing memory to show lcommunity
information.  We then immediately drop it.  Account for
that memory properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobgpd: Fix missed unlocks
Donald Sharp [Sat, 14 Nov 2020 20:32:49 +0000 (15:32 -0500)]
bgpd: Fix missed unlocks

When iterating over the bgp_dest table, using this pattern:

for (dest = bgp_table_top(table); dest;
     dest = bgp_route_next(dest)) {

If the code breaks or returns in the middle we will not have
properly unlocked the node as that bgp_table_top locks the top
dest and bgp_route_next locks the next dest and unlocks the old
dest.

From code inspection I have found a bunch of places that
we either return in the middle of or a break is issued.

Add appropriate unlocks.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agodoc: fix dup label in bgp doc
Mark Stapp [Thu, 12 Nov 2020 21:26:25 +0000 (16:26 -0500)]
doc: fix dup label in bgp doc

Make a label about v6 unique.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib, bgpd: fix crash using skiplist debug function
Emanuele Bovisio [Thu, 5 Nov 2020 13:36:00 +0000 (14:36 +0100)]
lib, bgpd: fix crash using skiplist debug function

calling "skiplist test" and then "skiplist debug",
there was a crash due to a freed pointer.

Agreed to remove static pointer (see PR #7474).

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
4 years agodocs: mention activate keyword in user docs
Michael Hohl [Wed, 11 Nov 2020 15:56:15 +0000 (16:56 +0100)]
docs: mention activate keyword in user docs

As of now, the BGP user documentation does not explicitly mention how
to use IPv6. This commit adds documentation of the activate command to
the user documentation which is crucial to get IPv6 networks announced
using FRRouting.

Signed-off-by: Michael Hohl <me@michaelhohl.net>
4 years agobgpd: withdraw any exported routes when deleting a vrf
Pat Ruddy [Thu, 29 Oct 2020 16:38:42 +0000 (16:38 +0000)]
bgpd: withdraw any exported routes when deleting a vrf

When a BGP vrf instance is deleted, the routes it exported into the
main VPN table are not deleted and they remain as stale routes
attached to an unknown bgp instance. When the new vrf instance comes
along, it imports these routes from the main table and thus we see
duplicatesalongside its own identical routes.
The solution is to call the unexport logic when a BGP vrf instance is
being deleted.

problem example
---------------
volta1# sh bgp vrf VRF-a ipv4 unicast
BGP table version is 4, local router ID is 18.0.0.1, vrf id 5
Default local pref 100, local AS 567
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 7.0.0.6/32       7.0.0.5@0<              10    100      0 ?
*> 7.0.0.8/32       18.0.0.8                 0             0 111 ?
*> 18.0.0.0/24      18.0.0.8                 0             0 111 ?
*> 56.0.0.0/24      7.0.0.5@0<               0    100      0 ?
Displayed  4 routes and 4 total paths
volta1# conf t
volta1(config)# no router bgp 567 vrf VRF-a
volta1(config)#
volta1(config)# router bgp 567 vrf VRF-a
volta1(config-router)#  bgp router-id 18.0.0.1
volta1(config-router)#  no bgp ebgp-requires-policy
volta1(config-router)#  no bgp network import-check
volta1(config-router)#  neighbor 18.0.0.8 remote-as 111
volta1(config-router)#  !
volta1(config-router)#  address-family ipv4 unicast
volta1(config-router-af)#   label vpn export 12345
volta1(config-router-af)#   rd vpn export 567:111
volta1(config-router-af)#   rt vpn both 567:100
volta1(config-router-af)#   export vpn
volta1(config-router-af)#   import vpn
volta1(config-router-af)#  exit-address-family
volta1(config-router)# !
volta1(config-router)# end
volta1# sh bgp vrf VRF-a ipv4 unicast
BGP table version is 4, local router ID is 18.0.0.1, vrf id 5
Default local pref 100, local AS 567
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 7.0.0.6/32       7.0.0.5@0<              10    100      0 ?
*  7.0.0.8/32       18.0.0.8                 0             0 111 ?
*>                  18.0.0.8@-<              0             0 111 ?
*  18.0.0.0/24      18.0.0.8                 0             0 111 ?
*>                  18.0.0.8@-<              0             0 111 ?
*> 56.0.0.0/24      7.0.0.5@0<               0    100      0 ?
Displayed  4 routes and 6 total paths

@- routes indicating unknown bgp instance are imported

Signed-off-by: Pat Ruddy <pat@voltanet.io>
4 years agostaticd: fixed memory leak on shudown
vdhingra [Fri, 23 Oct 2020 12:09:24 +0000 (05:09 -0700)]
staticd: fixed memory leak on shudown

When shutdown triggered, info pointer pointing to
static_route_info was not getting released for
route_table and srcdest_table.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agobgpd: avoid needless ebgp mhop reset
Emanuele Di Pascale [Mon, 9 Nov 2020 10:05:04 +0000 (11:05 +0100)]
bgpd: avoid needless ebgp mhop reset

if the user sets the ebgp-multihop for a neighbor to the same value
we currently have, avoid resetting the session and just return a
silent success.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agodoc: fix vrrp block quote
Quentin Young [Mon, 9 Nov 2020 21:19:13 +0000 (16:19 -0500)]
doc: fix vrrp block quote

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agodoc: use anonymous link refs
Quentin Young [Mon, 9 Nov 2020 20:17:18 +0000 (15:17 -0500)]
doc: use anonymous link refs

rst...

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agotests: only test count of nexthops in bgp max-paths test
Mark Stapp [Tue, 10 Nov 2020 14:50:50 +0000 (09:50 -0500)]
tests: only test count of nexthops in bgp max-paths test

Add support to compare the number of RIB nexthops, rather than the
specific nexthop addresses. Use this in the bgp_ecmp topotests that
test maximum-paths - testing the specific nexthops is wrong there,
it's not deterministic and we get spurious failures.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agozebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY
Anuradha Karuppiah [Sat, 9 May 2020 02:53:36 +0000 (19:53 -0700)]
zebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY

(ndm_state & NUD_NOARP) - prevents the entry from expiring
(ndm_flags & NTF_STICKY) - prevents station moves on the entry

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 years agonhrpd: Fix memory leak on shutdown
Donald Sharp [Sat, 7 Nov 2020 01:56:02 +0000 (20:56 -0500)]
nhrpd: Fix memory leak on shutdown

On shutdown we were blantantly dropping the node->info
data.  Make it happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agodoc: fix sphinx complaint about indent levels
Mark Stapp [Mon, 9 Nov 2020 17:44:44 +0000 (12:44 -0500)]
doc: fix sphinx complaint about indent levels

There was an inconsistency in the characters used for the second
level of title/section hierarchy - fix it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd: Correct CLI description for `debug bgp keepalives`
Donatas Abraitis [Sat, 7 Nov 2020 15:22:34 +0000 (17:22 +0200)]
bgpd: Correct CLI description for `debug bgp keepalives`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodoc: add crosslink to developer docs
Quentin Young [Wed, 4 Nov 2020 22:33:17 +0000 (17:33 -0500)]
doc: add crosslink to developer docs

for source build instructions

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agodoc: explain integrated config
Quentin Young [Wed, 4 Nov 2020 22:29:58 +0000 (17:29 -0500)]
doc: explain integrated config

This is poorly documented and confusing to users

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agodoc: add troubleshooting info for vrrp
Quentin Young [Wed, 4 Nov 2020 22:21:33 +0000 (17:21 -0500)]
doc: add troubleshooting info for vrrp

Signed-off-by: Quentin Young <qlyoung@nvidia.com>