Commit Graph

162 Commits

Author SHA1 Message Date
Donald Sharp
d381190a55 zebra: Remove tag from zebra_rmap_obj
The tag value in all cases was being set to the re->tag.
re is already stored, so let's just use that.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 11:21:03 -04:00
Donald Sharp
17bcaad841 zebra: Use the re->metric instead of 0 for zebra_rmap_obj
The zebra_rmap_obj was storing the re->metric and allowing
matches against it, but in most cases it was just using 0.
Use the Route entries metric instead.  This should fix
some bugs where a match metric never worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 11:17:29 -04:00
Donald Sharp
b7542d5af8 zebra: Remove instance from zebra_rmap_obj data structure
In all cases the instance is derived from the re pointer
and since the re pointer is already stored, let's just
remove it from the game and cut to the chase.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 11:15:06 -04:00
Donald Sharp
cad4d0c332 zebra: Replace source_protocol with just using re in route map object
Replace the source_protocol with just saving a pointer to the re
in the `struct zebra_rmap_obj` data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 11:11:40 -04:00
Donald Sharp
8d56ba855b zebra: Remove vrf_id from passed around object
The nexthop that is stored already knows it's nexthop and
in all cases the vrf id is derived from the nexthop->vrf_id
let's just cut to the chase and not do this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 11:06:04 -04:00
Donald Sharp
112bb33db5 zebra: import table match against interface name could fail
If an import table route-map is trying to match against
a particular interface, The code is matching against
the actual vrf the route entry is in -vs- the vrf
the nexthop entry is in.  Let's modify the code
to actually allow the import table entry to match
against the nexthops vrf.

Not working:

ip import-table 91
ip import-table 93 route-map FOO
no service integrated-vtysh-config
!
debug zebra events
!
interface green
 ip address 192.168.4.3/24
exit
!
route-map FOO permit 10
 match interface green
exit

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, 1d10h07m
T[91]>* 1.2.3.5/32 [15/0] via 192.168.119.1, enp13s0, 00:00:05
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr0 linkdown, 1d16h34m
C>* 192.168.44.0/24 is directly connected, virbr1, 01:30:51
C>* 192.168.45.0/24 is directly connected, virbr2, 01:30:51
C>* 192.168.119.0/24 is directly connected, enp13s0, 1d16h34m
C>* 192.168.122.0/24 is directly connected, virbr0 linkdown, 01:30:51
eva# show ip route table 91
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 91:
K>* 1.2.3.5/32 [0/0] via 192.168.119.1, enp13s0, 00:00:15
eva# show ip route table 93
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 93:
K * 1.2.3.4/32 [0/0] via 192.168.4.5, green (vrf green), 00:03:05

Working:

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, 00:03:09
T[93]>* 1.2.3.4/32 [15/0] via 192.168.4.5, green (vrf green), 00:02:21
T[91]>* 1.2.3.5/32 [15/0] via 192.168.119.1, enp13s0, 00:02:26
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr0, 00:03:09
C>* 192.168.44.0/24 is directly connected, virbr1, 00:03:09
C>* 192.168.45.0/24 is directly connected, virbr2, 00:03:09
C>* 192.168.119.0/24 is directly connected, enp13s0, 00:03:09
C>* 192.168.122.0/24 is directly connected, virbr0, 00:03:09
eva# show ip route table 91
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 91:
K * 1.2.3.5/32 [0/0] via 192.168.119.1, enp13s0, 00:03:12
eva# show ip route table 93
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default table 93:
K * 1.2.3.4/32 [0/0] via 192.168.4.5, green (vrf green), 00:03:14

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 10:33:16 -04:00
Donald Sharp
28a8065ec4 zebra: Rename struct nh_rmap_obj to struct zebra_rmap_obj
This structure is really the generic route map object for
handling routemaps in zebra.  Let's name it appropriately.
Future commits will consolidate the data to using the
struct route_entry as part of this data instead of copying
bits and bobs of it.  This will allow future work to
set/control the route_entry more directly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 10:33:16 -04:00
guozhongfeng
1193611f8e zebra: The command ipv6 nht xxx not work
If the command is ipv6 nht protocol route-map rmap, this parameter should use AFI_IP6

Signed-off-by: guozhongfeng <guozhongfeng.gzf@alibaba-inc.com>
2023-07-16 17:52:31 +08:00
Russ White
c0656e9040
Merge pull request #12837 from donaldsharp/unlikely_routemap
Unlikely routemap
2023-04-04 08:20:25 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cc09ba4584 bgpd, ospfd, zebra: Use unlikely for DEBUG_ROUTEMAP_DETAIL
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-23 07:54:56 -04:00
Donald Sharp
8383d53e43
Merge pull request #12780 from opensourcerouting/spdx-license-id
*: convert to SPDX License identifiers
2023-02-17 09:43:05 -05:00
Donald Sharp
774cd0cd6c zebra: Add access-list lookup failures to debug routemap detail
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-13 09:40:47 -05:00
Donald Sharp
ca4795dae6 zebra: Add prefix-list lookup failures to routemap debug detail
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-13 09:40:47 -05:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Donald Sharp
a98701f053 zebra: Add missing enums to switch statements
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 15:15:42 -05:00
Sindhu Parvathi Gopinathan
63e7deba05 zebra: json support for show ip nht route-map
Changes:
JSON support added for below commands,
     - show ip nht route-map vrf all json
     - show ip nht route-map vrf <name> json
     - show ipv6 nht route-map vrf all json
     - show ipv6 nht route-map vrf <name> json
     - show ipv6 nht route-map json
     - show ip nht route-map json

Testing Done: Unit testing completed.

tor-1# show ip nht route-map vrf default json
{
  "afi":"ipv4",
  "vrfs":{
	"default":{
	  "protocols":{
		"system":"none",
		"kernel":"none",
		"connected":"connected-policy",
		"static":"none",
		"rip":"none",
		"ripng":"none",
		"ospf":"none",
		"ospf6":"none",
		"isis":"none",
		"bgp":"bgp-policy",
		"pim":"none",
		"eigrp":"none",
		"nhrp":"none",
		"hsls":"none",
		"olsr":"none",
		"table":"none",
		"ldp":"none",
		"vnc":"none",
		"vnc-direct":"none",
		"vnc-rn":"none",
		"bgp-direct":"none",
		"bgp-direct-to-nve-groups":"none",
		"babel":"none",
		"sharp":"none",
		"pbr":"none",
		"bfd":"none",
		"openfabric":"none",
		"vrrp":"none",
		"zebra":"none",
		"frr":"none",
		"wildcard":"none",
		"any":"none"
	  }
	}
  }
}

tor-1# show ip nht route-map vrf all json
{
  "afi":"ipv4",
  "vrfs":{
	"default":{
	  "protocols":{
		"system":"none",
		"kernel":"none",
		"connected":"connected-policy",
		"static":"none",
		"rip":"none",
		"ripng":"none",
		"ospf":"none",
		"ospf6":"none",
		"isis":"none",
		"bgp":"bgp-policy",
		"pim":"none",
		"eigrp":"none",
		"nhrp":"none",
		"hsls":"none",
		"olsr":"none",
		"table":"none",
		"ldp":"none",
		"vnc":"none",
		"vnc-direct":"none",
		"vnc-rn":"none",
		"bgp-direct":"none",
		"bgp-direct-to-nve-groups":"none",
		"babel":"none",
		"sharp":"none",
		"pbr":"none",
		"bfd":"none",
		"openfabric":"none",
		"vrrp":"none",
		"zebra":"none",
		"frr":"none",
		"wildcard":"none",
		"any":"none"
	  }
	},
	"mgmt":{
	  "protocols":{
		"system":"none",
		"kernel":"none",
		"connected":"none",
		"static":"none",
		"rip":"none",
		"ripng":"none",
		"ospf":"none",
		"ospf6":"none",
		"isis":"none",
		"bgp":"none",
		"pim":"none",
		"eigrp":"none",
		"nhrp":"none",
		"hsls":"none",
		"olsr":"none",
		"table":"none",
		"ldp":"none",
		"vnc":"none",
		"vnc-direct":"none",
		"vnc-rn":"none",
		"bgp-direct":"none",
		"bgp-direct-to-nve-groups":"none",
		"babel":"none",
		"sharp":"none",
		"pbr":"none",
		"bfd":"none",
		"openfabric":"none",
		"vrrp":"none",
		"zebra":"none",
		"frr":"none",
		"wildcard":"none",
		"any":"none"
	  }
	},
	"sym_1":{
	  "protocols":{
		"system":"none",
		"kernel":"none",
		"connected":"none",
		"static":"none",
		"rip":"none",
		"ripng":"none",
		"ospf":"none",
		"ospf6":"none",
		"isis":"none",
		"bgp":"bgp-policy",
		"pim":"none",
		"eigrp":"none",
		"nhrp":"none",
		"hsls":"none",
		"olsr":"none",
		"table":"none",
		"ldp":"none",
		"vnc":"none",
		"vnc-direct":"none",
		"vnc-rn":"none",
		"bgp-direct":"none",
		"bgp-direct-to-nve-groups":"none",
		"babel":"none",
		"sharp":"none",
		"pbr":"none",
		"bfd":"none",
		"openfabric":"none",
		"vrrp":"none",
		"zebra":"none",
		"frr":"none",
		"wildcard":"none",
		"any":"none"
	  }
	}
  }
}

tor-1# show ipv6 nht route-map vrf default json
{
  "afi":"ipv6",
  "vrfs":{
	"default":{
	  "protocols":{
		"system":"none",
		"kernel":"kernel-policy",
		"connected":"connected-policy",
		"static":"none",
		"rip":"none",
		"ripng":"none",
		"ospf":"none",
		"ospf6":"none",
		"isis":"none",
		"bgp":"none",
		"pim":"none",
		"eigrp":"none",
		"nhrp":"none",
		"hsls":"none",
		"olsr":"none",
		"table":"none",
		"ldp":"none",
		"vnc":"none",
		"vnc-direct":"none",
		"vnc-rn":"none",
		"bgp-direct":"none",
		"bgp-direct-to-nve-groups":"none",
		"babel":"none",
		"sharp":"none",
		"pbr":"none",
		"bfd":"none",
		"openfabric":"none",
		"vrrp":"none",
		"zebra":"none",
		"frr":"none",
		"wildcard":"none",
		"any":"none"
	  }
	}
  }
}

Ticket:#3229016
Issue:3229016

Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
2022-12-16 08:42:53 -08:00
Donald Sharp
cda0f501fb zebra: Free up routemap name memory on vrf deletion event
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-09 09:47:06 -05:00
David Lamparter
89cb86aeb0 build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.

This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.

Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01:00
David Lamparter
0cbed9511a lib, zebra, pimd: clean up/fix VRF DECLVAR macros
There's a common pattern of "get VRF context for CLI node" here, which
first got a helper macro in zebra that then permeated into pimd.

Unfortunately the pimd copy wasn't quite adjusted correctly and thus
caused two coverity warnings (CID 1517453, CID 1517454).

Fix the PIM one, and clean up by providing a common base macro in
`lib/vty.h`.

Also rename the macros (add `_VRF`) to make more clear what they do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-28 11:09:26 +02:00
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
Donald Sharp
d597533a9d zebra: Start carrying safi for rnh processing
PIM is going to need to be able to send down the address it is
trying to resolve in the multicast rib.  We need a way to signal
this to the end developer.  Start the conversion by adding the
ability to have a safi.  But only allow SAFI_UNICAST at the moment.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
6071e5e96e zebra: remove 'enum rnh_type' from system
This code is now dead code since there are not two
nexthop resolution types.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
David Lamparter
09781197b6 build: make builddir include path consistent
... by referencing all autogenerated headers relative to the root
directory.  (90% of the changes here is `version.h`.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21 15:42:33 +02:00
Sarita Patra
e71627cbcb zebra: North-bound implementation for zebra rmaps
This commit introduces the implementation for the north-bound
callbacks for the zebra-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
2021-03-30 22:58:42 +03:00
David Lamparter
224ccf29d9 zebra: kill zebra_memory.h, use MTYPE_STATIC
This one also needed a bit of shuffling around, but MTYPE_RE is the only
one left used across file boundaries now.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-22 20:02:17 +01:00
Donald Sharp
431deca7ea
Merge pull request #7905 from mjstapp/fix_zapi_nhg
zebra, sharpd: async results for NHGs
2021-01-25 10:29:04 -05:00
Mark Stapp
f5b7e50f9a zebra: use afi_t for route-map address family arg
Use afi_t in the route_map_check api

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-01-21 10:13:57 -05:00
Donald Sharp
d33da0e071 zebra: A zebra route-map delay-timer 0 command should still run the route-map
Setting `zebra route-map delay-timer 0` completely turns of any
route-map processing in zebra.  Which is completely wrong.  A timer
of 0 means `do it now`.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
4dfcfabfa9 zebra: Push timer out if another route-map change comes in for zebra
If we are running with a delayed timer to handle route-map changes
in zebra, if another route-map change is made to the cli, push
out the timer instead of not modifying the timer.  This will
allow a large set of route-maps to be possibly be read in by
the system and we don't have a state where new route-map
changes are being read in and having the timer pop in
the middle of it.

Additionally convert to use THREAD_OFF, preventing a possible
use after free as well as aligning the thread api usage
with what we consider correct.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
cfcd844c0b zebra: Limit routemap changes to reconsider only routes associated with that rm
Current code when a route map changes schedules a rerun of all routes in the
particular table.  So if you modify the `ip protocol XX route-map FOO`
route-map `FOO` all routes will be rechecked.  This is extremely expensive.

Modify zebra to only update the routes associated with the route-map.  So
if we have 800k bgp routes and 50 ospf routes and we are route-map'ing
the ospf routes we'll only look at 50 routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
54aeba3540 zebra: Allow rib_update_table to receive a specified route type
When we need to cause a reprocessing of data the code currently
marks all routes as needing to be looked at.  Modify the
rib_update_table code to allow us to specify a specific route
type we only want to reprocess.  At this point none
of the code is behaving differently this is just setup
for a future code change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
3d34678f1d doc: Document the "zebra route-map delay-timer" functionality
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
9df81095f8 zebra: zebra route-map delay-timer is global not per vrf
The zebra route-map delay timer value is a global value
not a per vrf change.  As such we should only print it
out one time.

We are seeing this:

zebra route-map delay-timer 33
 exit-vrf
zebra route-map delay-timer 33

When we have 2 vrf's configured.

Fix the code to only write it out for the default vrf

Ticket: CM-32888
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-08 22:34:41 -05:00
Donald Sharp
c70e585e05 zebra: Remove uncalled function
Remove the dead function zebra_route_map_write_delay_timer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-08 22:34:41 -05:00
Donatas Abraitis
82b773e63b
Merge pull request #7524 from donaldsharp/zebra_route_map_tighten
zebra: deny when route map is specified but does not exist yet
2020-12-10 11:01:25 +02:00
Donald Sharp
fd303a4ba1 zebra: deny when route map is specified but does not exist yet
If we have `ip protocol <proto> route-map FOO` and FOO has
not been defined in any way shape fashion or form, we
should deny the match instead of permitting it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-13 21:11:48 -05:00
Donald Sharp
1782514fb9 *: Remove route_map_object_t from the system
The route_map_object_t was being used to track what protocol we were
being called against.  But each protocol was only ever calling itself.
So we had a variable that was only ever being passed in from route_map_apply
that had to be carried against and everyone was testing if that variable
was for their own stack.

Clean up this route_map_object_t from the entire system.  We should
speed some stuff up.  Yes I know not a bunch but this will add up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-13 19:35:20 -05:00
Mark Stapp
5047884528 *: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 12:16:52 -04:00
Mark Stapp
b3d6bc6ef0 * : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 08:59:34 -04:00
Renato Westphal
ca77b518bd *: introduce DEFPY_YANG & friends
DEFPY_YANG will allow the CLI to identify which commands are
YANG-modeled or not before executing them. This is going to be
useful for the upcoming configuration back-off timer work that
needs to commit pending configuration changes before executing a
command that isn't YANG-modeled.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-03 15:17:03 -03:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Rafael Zalamena
07d030ea09 zebra: migrate route map commands to northbound
Lets use the newly implemented zebra northbound to configure route maps.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-03-23 07:55:13 -03:00
saravanank
a2665e381c zebra: Disable rmap update thread before routemap_finish while shutting down zebra
Problem: While zebra going down, rmap update thread is being called as part of
timer event. This make zebra to crash.

RCA: At this time route_map_master_hash is made to 0 by sig int handler.
This is causing Zebrad to crash while executing rmap update thread

Fix: As part of SIGINT handler, before calling routemap_finish,
thread off any routemap update scheduled at that point and make sure that
it wont get scheduled again by making the timeout as 0.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-03-16 23:57:45 -07:00
Donatas Abraitis
95f7965d09 *: Remove parenthesis on return for constants
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-09 14:21:56 +02:00
David Lamparter
364deb0487 *: make all route_map_rule_cmd const
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30 00:38:32 +01:00
Donald Sharp
59f8141924 zebra: Fix show ip nexthop route-map and show ip protocol
These commands were not properly lining up in their columns.
Fix this.

After:
VRF: default
Protocol                  : route-map
-------------------------------------
bgp                       : NO_INSTALL
vnc-direct                : none
vnc-rn                    : none
bgp-direct                : none
bgp-direct-to-nve-groups  : none

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 20:14:21 -05:00
vdhingra
909f3d56ae lib: rmap dep table is not correct in case of exact-match clause
User pass the string match large-community 1 exact-match from CLI.
Now route map lib has got the string as "1 exact-match". It passes the string
to call back for compilation. BGP will parse this string and came to know
that for "1" it has to do exact match. Routemap lib has to save "1" in it’s
dependency table. Here routemap is saving this as a “1 exact-match”
which is wrong. The solution is used the compiled data.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2019-09-15 05:45:27 -07:00