Commit Graph

29152 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
4190587a3f
Merge pull request #10713 from donaldsharp/enum_fixup
lib, ospfd: Enum fixup
2022-03-02 16:29:46 -06:00
Donald Sharp
5f503e5f5a lib: Fix corruption when routemap delete/add sequence happens
If a operator issues a series of route-map deletions and
then re-adds, *and* this triggers the hash table to realloc
to grow to a larger size, then subsuquent route-map operations
will be against a corrupted hash table.

Why?

Effectively the route-map code was inserting each
route-map <NAME> into a hash for storage.  Upon
deletion there is this concept of delayed processing
so the routemap code sets a bit `to-be-processed`
and marks the route-map for deletion.  This is
1 entry in the hash table.  Then if the operator
recreates the hash, FRR would add another hash
entry.  If another deletion happens then there
now are 2 deletion entries that are indistinguishable
from a hash perspective.

FRR stores the deleted name of the route-map so that
any delayed processing can lookup the name and only process
those peers that are related to that route-map name.
This is good as that if in say BGP, we do not want
to reprocess all the peers that don't use the route-map.

Solution:
The whole purpose of the delay of deletion and the
storage of the route-map is to allow the using protocol
the ability to process the route-map at a later time
while still retaining the route-map name( for more efficient
reprocessing ).  The problem exists because we are keeping
multiple copies of deletion events that are indistinguishable
from each other causing hash havoc.

The truth is that we only need to keep 1 copy of the
routemap in the table.  If the series of events is:
a) delete ( schedule processing )
b) add ( reschedule processing )

Current code ends up processing the route-map two times
and in this event we really just need to reprocess everything
with the new route-map.

If the series of events is:
a) delete (schedule processing )
b) add (reschedule)
c) delete (reschedule)
d) add (reschedule)

All this really points to is that FRR just needs to keep the last
in the series of maps and ensuring that FRR knows that we need
to continue processing the route-map.  So in the creation processing
if the hash has an entry for this map, the routemap code knows that
this is a deletion event.  Mark this route-map for later processing
if it was marked so.  Also in the lookup function do not return
a map if the map found was deleted.

Fixes: #10708
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02 15:41:54 -05:00
Rafael Zalamena
54aeec5ef0 lib,vtysh: show operational data with config
Add option to merge configuration data in the operational data show
command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-02 16:37:43 -03:00
Renato Westphal
9b40fa1eae lib: fix iteration over YANG presence containers
State-only and configuration presence-containers need to be treated
differently when iterating over YANG operational data. Currently the
get_elem() callback is used to know when a state-only p-container
exists or not, and configuration p-containers are assumed to always
exist, which is clearly wrong. Fix this by checking the running
configuration to know whether a rw p-container exists or not.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-03-02 16:32:05 -03:00
Rafael Zalamena
852dfb3013 lib: fix show yang operational state output
Don't show default configuration values for state nodes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-02 16:31:47 -03:00
Javier Garcia
432f143212 topotest: Add test for isis json cmds.
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-03-02 16:21:29 +01:00
Javier Garcia
a2cac12a63 isisd: Add json to show isis database command.
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-03-02 16:20:44 +01:00
Donald Sharp
91f2045d53 lib: Fix zclient.c enum event to enum zclient_event
zclient.c is using `enum event` let's rename it to a better
named data structure `enum zclient_event`.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02 09:19:05 -05:00
Donald Sharp
14416b1f33 ospfd: Convert enum event to enum ospf_apiserver_event
Let's name this something more appropriate to
what is being done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02 09:17:57 -05:00
Donald Sharp
55a70ffb78 lib: Rename enum event to enum vty_event
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02 09:17:47 -05:00
David Lamparter
0455229c5d pim6d: reenable NHT code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 11:01:47 +01:00
David Lamparter
bc97f40dff pim6d: fixup NHT code for IPv6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 11:01:46 +01:00
David Lamparter
6564f5e5a5 Merge pull request #10657 from patrasar/pim_remove_in_addr_none
[manual merge to edit comment, didn't want to incur another cycle]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 10:42:17 +01:00
David Lamparter
b369d0cc40 pimd: fix stray comment referencing INADDR_NONE
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-02 10:41:22 +01:00
David Lamparter
f2ec36de77
Merge pull request #10684 from mobash-rasool/join-prune 2022-03-02 09:29:02 +01:00
Jafar Al-Gharaibeh
5aad2b6a82
Merge pull request #10652 from mobash-rasool/fixes
pimd: FRR drops IGMP packets for TOS value other than 0XC0
2022-03-01 13:31:49 -06:00
Jafar Al-Gharaibeh
ec616c97ba
Merge pull request #10697 from donaldsharp/free_bsd_clock_gettime
lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going back…
2022-03-01 12:48:47 -06:00
sarita patra
cc144e8b6b pimd: replace inaddr_none with PIMADDR_ANY
We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr
when there is no rp configured for group_all.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 09:45:56 -08:00
Mark Stapp
33fec964f7
Merge pull request #10699 from opensourcerouting/vtysh-live-log-coverity
vtysh: fix coverity issues in live-log code
2022-03-01 12:07:08 -05:00
Javier Garcia
a21177f280 isisd: Add json to show isis neighbor command.
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-03-01 17:57:21 +01:00
sarita patra
63ee25c0ba pim6d: Adding ipv6 mroute INTERFACE X:X::X:X [X:X::X:X]" cli
This cli is used to add multicast route on interface

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:45 -08:00
sarita patra
52c52d7806 pim6d: Adding "ipv6 multicast boundary oil WORD" cli
This cli is used to define multicast boundary on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:45 -08:00
sarita patra
2b16b40fc7 pim6d: Adding "ipv6 pim sm" cli
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:44 -08:00
sarita patra
dab0ac2955 pim6d: Adding "ipv6 pim ssm" cli
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:44 -08:00
sarita patra
7e01b641ae pim6d: Adding "[no] ipv6 pim active-active" cli
This cli used to mark the interface as active-active.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 07:23:42 -08:00
David Lamparter
3030e7b5ac vtysh: fix coverity issues in live-log code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-01 16:00:56 +01:00
sarita patra
e6aab61395 pim6d: Adding "ipv6 pim hello (1-65535) [(1-65535)]" CLI
This cli used to configure PIMV6 hello and hold timer on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:26:13 -08:00
sarita patra
bb387611c6 pim6d: Adding "ipv6 pim dr-priority" CLI
This cli used to configure PIMV6 dr-priority on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:24:16 -08:00
sarita patra
a1caf7a88f pim6d: Adding "ipv6 pim" CLI
This cli used to enable PIMV6 on interface.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:24:14 -08:00
Donald Sharp
d3689deef2
Merge pull request #10690 from opensourcerouting/snap-fix-libelf
snapcraft: Add missing libelf-dev build package
2022-03-01 09:12:36 -05:00
Donald Sharp
4e2839de64 lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards
On FreeBSD I have noticed that subsuquent calls to clock_gettime(..)
can return an after time that is before first calls value.
This in turn is generating CPU_HOG's because the subtraction
is wrapping into very very large numbers:

2022/02/28 20:12:58 SHARP: [PTDQA-70FG5]     start: 35.741981000  now: 35.740581000
2022/02/28 20:12:58 SHARP: [XK9YH-ZD8FA][EC 100663313] CPU HOG: task zclient_read (800744240) ran for 0ms (cpu time 18446744073709550ms)

(Please note I added the first line of debug to figure this issue out).

I have been asked to open a FreeBSD bug report and have done so.
In the mean time I think that it is important that FRR does
not generate bogus CPU HOG's on FreeBSD ( especially since
this may or may not be easily fixed and FRR has no control
over what version of the operating system, operators are
going to be running with FRR.

So, add a bit of specialized code that checks to see if
the after time in FreeBSD is before the now time in
thread_consumed_time and do some quick manipulations
to not have this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-01 09:08:32 -05:00
David Lamparter
2821405a69
Merge pull request #10640 from donaldsharp/thread_timers 2022-03-01 11:45:36 +01:00
David Lamparter
17dd5ca8f8
Merge pull request #10584 from donaldsharp/workflow_modification 2022-03-01 11:44:57 +01:00
David Lamparter
145ce1825c
Merge pull request #10634 from patrasar/master_pimv6_last_lookup 2022-03-01 09:39:52 +01:00
sarita patra
3e394a7729 pim6d: Handling pim_rpf for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:30:03 -08:00
Donatas Abraitis
4e6e0ac2bf
Merge pull request #10691 from anlancs/bgp-evpn-check
bgpd: fix missing name of default vrf
2022-03-01 10:13:15 +02:00
sarita patra
113f29b90d pim6d: Handling last_lookup in pim_nexthop for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 18:03:12 -08:00
sarita patra
d4addb4839 pim6d: moving FRR_PIM_AF_XPATH_VAL into pim_nb.h
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 15:57:47 -08:00
Martin Winter
720f01c5c1
snapcraft: Add missing libelf-dev build package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2022-03-01 00:41:29 +01:00
Jafar Al-Gharaibeh
868efb9e9f
Merge pull request #10672 from donaldsharp/bsd_zebra_graceful_restart_cleanup
Bsd zebra graceful restart cleanup
2022-02-28 14:57:35 -06:00
Jafar Al-Gharaibeh
0acdda46c4
Merge pull request #10683 from donaldsharp/correct_vrf
zebra: Use the routes vrf not the nexthop vrf for route-map application
2022-02-28 14:47:16 -06:00
Sri Mohana Singamsetty
32c7d45175
Merge pull request #10682 from mjstapp/fix_zebra_doc
doc: fix typo in zebra doc
2022-02-28 10:54:31 -08:00
Mobashshera Rasool
17280eee1f pimd: Handle pim join/prune recv flow for ipv6
Making the code changes to handle both ipv4 and ipv6 in the same code

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 10:36:04 -08:00
Donald Sharp
45dafca86c zebra: Use the routes vrf not the vrf of the nexthop for route-map application
When a end operator is doing cross vrf imports in bgp:

router bgp 3239 vrf FOO
  address-family ipv4 uni
    import vrf BAR
!

and zebra has this configuration:

vrf FOO
  ip protocol bgp route-map EVA
!

The current code in zebra_nhg.c was looking up the vrf of the
nexthop and attempting to apply the ip protocol route-map.

For most people the nexthop vrf and the re vrf are one and the
same so they never see a problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 13:08:01 -05:00
David Lamparter
ee95029ac4
Merge pull request #10424 from patrasar/master_pimv6_nht 2022-02-28 17:50:42 +01:00
sarita patra
90ab4458a1 pim6d: pim_nht changes for pimv6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 13:36:02 -08:00
Mark Stapp
2f5997dc56 doc: fix typo in zebra doc
Fix a typo in the zebra doc file that triggers a warning.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-02-28 11:28:25 -05:00
Jafar Al-Gharaibeh
5ff968abbe
Merge pull request #10678 from donaldsharp/staticd_make_check_fix
staticd: Fix `make check` failures
2022-02-28 09:40:12 -06:00
Donald Sharp
4e7a5f06be
Merge pull request #10668 from Jafaral/frr-conf-topotest
topotests: add support for frr.conf as a unified config
2022-02-28 10:28:10 -05:00
David Lamparter
b9db469fe9
Merge pull request #10667 from donaldsharp/bufsize 2022-02-28 15:56:51 +01:00