Commit Graph

27618 Commits

Author SHA1 Message Date
David Schweizer
a533bb8cac
pimd/pim_cmd.c: fix typo in IGMP iface stats JSON
Changes correct typo in JSON output for IGMP interface statistics show
command from "leaveV3" to "leaveV2".

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2022-03-07 14:18:09 +01:00
Donald Sharp
75ba864c81 bgpd: Warn user when an interface has no v6 LL address associated with it
When BGP detects that a peering is using a global address but no v6 LL
address has been created for the interface that the global address is
on warn the user that something is amiss and they need to fix it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-07 08:00:26 -05:00
Donatas Abraitis
583ba572b7
Merge pull request #10732 from anlancs/zebra-minor-move
zebra: Delay the usage of one variable
2022-03-07 12:15:43 +02:00
Christian Hopps
fe095adc24 lib: grpc: fix handling of "empty" yang type
- rather than coerce `const char *` to std:string&, just pass the
C ptr, as that's what is used anyway.

fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-06 12:00:22 -05:00
Christian Hopps
83f6fce7d2 lib: grpc: fix shutdown code
fixes #9732

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-06 12:00:17 -05:00
Christian Hopps
c85ecd6405 lib: grpc: initialize uninitialized member variables
fixes #9732, fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-06 07:39:58 -05:00
Christian Hopps
96d434f853 lib: grpc: do not remove candidate entry too soon
Fix from Rafael Zalamena <rzalamena@opensourcerouting.org>

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-06 07:37:52 -05:00
Rafael Zalamena
673e440770 lib: tweak northbound gRPC default timeout
Don't let open sockets hang for too long. This will fix an issue where a
improperly coded client (e.g. socat) could exaust the amount of open
file descriptors.

Documentation:
https://grpc.github.io/grpc/cpp/md_doc_keepalive.html

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-06 07:37:52 -05:00
Jafar Al-Gharaibeh
5e5cd2784f
Merge pull request #10734 from ton31337/fix/rpki_read
bgpd: Fix while(read()) for RPKI sync callback
2022-03-05 01:55:53 -06:00
anlan_cs
38eda16a24 zebra: Delay the usage of one variable until need
In the loop, local variable `ip` is always set even if the check condition
is not satisfied.

Avoid the redundant set, move this set exactly after the check condition is
satisfied. Set `ip` only if the check condition is met, otherwise needn't.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-05 06:57:35 +08:00
Donatas Abraitis
bfc30f1687 bgpd: Fix while(read()) for RPKI sync callback
Bad formatting applied and it worked with small amount of prefixes (lurking).

With full BGP feed and full RPKI table, this causes infinity loop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-05 00:14:37 +02:00
Donald Sharp
808fc9db0a
Merge pull request #10730 from mobash-rasool/fixes
lib: Route-map failed for OSPF routes even for matching prefixes
2022-03-04 08:27:11 -05:00
Mobashshera Rasool
a34ce5c5e4 lib: Route-map failed for OSPF routes even for matching prefixes
This issue is applicable to other protocols as well.
When user has used route-map, even though the prefixes are falling
under the permit rule, the prefixes were denied and were shown
as inactive route in zebra.

Reason being the parameter which is of type enum was passed to the api
route_map_get_index and was typecasted to uint8_t *.
This problem is visible in case of Big Endian systems because we are
accessing the most significant byte.

'match_ret' field is an enum in the caller and so it is of 4 bytes,
the typecasting it to 1 byte and passing it to the api made
the api to put the value in the most significant byte
which was already zero previously. Therefore the actual value
RMAP_NOMATCH which was 1 never gets reset in this case.
Therefore the api always returns 'RMAP_NOMATCH' and hence
the prefixes are always denied.

Fixes: #9782
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-04 03:57:09 -08:00
Ville Skyttä
79cf42e53a debian: include frr@.service in deb
Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
2022-03-04 13:10:08 +02:00
Donatas Abraitis
cd16c68376 doc: Drop unnecessary sentence about index.html changes for releases
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-04 09:53:16 +02:00
Donatas Abraitis
5c1d285012 doc: Add a couple of handy commands to get some info for release notes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-04 09:46:25 +02:00
Jafar Al-Gharaibeh
7469f084f3
Merge pull request #10723 from opensourcerouting/bgpd-show-flow-detail
bgpd: fix 'show bgp detail json' output
2022-03-03 23:11:32 -06:00
Chirag Shah
d5fdae8f45 zebra: fix crash in evpn neigh cleanup all
zebra crash is seen during shutdown (frr restart).

During shutdown, remote neigh and remote mac clean up
is triggered first, followed by per vni all neigh
(including local) and macs cleanup is triggered.

The crash occurs when a remote mac is cleaned up first
and its reference is remained in local neigh.
When local neigh attempt removes itself from its associated
mac's neigh_list it triggers inaccessible memory crash.

The fix is during mac deletion if its neigh_list is non-empty
then retain the MAC in AUTO state.
This can arise when MAC and neigh duo are in different state
(remote/local). Otherwise, the order of cleanup operation
is neighs followed by macs.

The auto mac will be cleaned up when per vni all neighs and macs
are cleaned up.

Ticket:CM-29826
Reviewed By:CCR-10369
Testing Done:

Configure evpn symmetric config where
MAC is in remote state and neigh is in local state.
Perform frr restart then crash is not seen.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-03 14:59:56 -08:00
Rafael Zalamena
3c1f92018b lib: rotate log file supplied by command line
Call `zlog_file_rotate` for command file lines as well otherwise on
`SIGUSR1` the old descriptor will still be used and no new log file will
be created for the rotation.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-03 18:28:08 -03:00
Rafael Zalamena
5be6fa9bf0 bgpd: fix 'show bgp detail json' output
Include the BGP_SHOW_OPT_DETAIL flag in the 'detail' version of the
command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-03-03 18:26:03 -03:00
Donald Sharp
8b48cdb913 zebra: Prevent installation of connected multiple times
With recent changes to interface up mechanics in if_netlink.c
FRR was receiving as many as 4 up events for an interface
on ifdown/ifup events.  This was causing timing issues
in FRR based upon some fun timings.  Remove this from
happening.

Ticket: CM-31623
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-02 18:34:32 -08:00
Chirag Shah
d78fa57195 zebra: protodown-up event trigger interface up
Vxlan interfaces flap (protodown/up) event,
non ptm operative interfaces do not come up
as protodown up event do not trigger "if_up()"
event.

Ticket:CM-30477
Reviewed By:CCR-10681
Testing Done:

validated interfaces flaps, ip link down, ifdown
and protodown followed by UP event. all Vxlan interfaces
come up in bgpd post flap.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-02 18:16:56 -08:00
Chirag Shah
2d04bd98ac zebra: handle protodown netlink for vxlan device
Frr need to handle protocol down event for vxlan
interface.
In MLAG scenario, one of the pair switch can put
vxlan port to protodown state, followed by
tunnel-ip change from anycast IP to individual IP.

In absence of protodown handling, evpn end up
advertising locally learn EVPN (MAC-IP) routes
with individual IP as nexthop.
This leads an issue of overwriting locally learn
entries as remote on MLAG pair.

Ticket:CM-24545
Reviewed By:CCR-10310
Testing Done:

In EVPN deployment, restart one of the MLAG
daemon, which puts vxlan interfaces in protodown state.
FRR treats protodown as oper down for vxlan interfaces.
VNI down cleans up/withdraws locally learn routes.
Followed by vxlan device UP event, re-advertise
locally learn routes.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-02 17:40:44 -08:00
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
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