Commit Graph

24361 Commits

Author SHA1 Message Date
Olivier Dugeon
4c7ce7bd28
Merge pull request #8585 from stipmonster/asan-fixes-ospf-te
ospfd: Fixed some ASAN errors
2021-04-30 11:34:32 +02:00
Philippe Guibert
dee1c6c338 nhrpd: move prototype to top of file
nhrp prototype function was not declared at top of the file.
fixing it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
e3d3fa06f7 zebra: collect gre information and push it when needed
- gre keys are collected and stored locally.
- when gre source set is requested, and the link interface
configured is different, the gre information collected is
pushed in the query, namely source ip or gre keys if present.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
db51f0cd10 nhrp: Preserve mtu during interface up/down and tunnel source change
preserve mtu upon interface flapping and tunnel source change.

Signed-off-by:Reuben Dowle <reuben.dowle@4rf.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
62b4b7e44a zebra: new dplane action to set gre link interface
This action is initiated by nhrp and has been stubbed when
moving to zebra. Now, a netlink request is forged to set
the link interface of a gre interface if that gre interface
does not have already a link interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
372b887859 nhrpd: clean up SA warning with strncpy
strncpy is replaced by strlcpy.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
aea6c49e01 nhrpd: cleaning netlink gre information
flush netlink related dependencies with gre information.
Add some linux headers required to compile with it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
7f48cfa5e4 nhrpd: redirect netlink gre with zebra
as zebra has a new api to get gre and set gre source commands,
netlink gre get and netlink gre source function calls are redirected to zebra
by using the zapi interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
d17af8dd04 lib, zebra: get gre information
the get gre information code is obtained by nhrp, via zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
b716ab61e2 zebra: add stub implementation for zebra gre source set
this functionality is stubbed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
632d83067c zebra: add 3 new gre commands, and enforce synchro mecanism
3 new gre commands are available:
- GRE_GET to permit a daemon to retrieve gre information.
- GRE_UPDATe is the reply message from zebra to the daemon. as it is a
  syncronous request, the GRE_GET expected will have to match the vrf id
  where the gre information is wished. this has an impact on label
  manager with change in APIs.
- SET_GRE_SOURCE. this command will be stubbed for now, assuming that
  the gre interface is set accordingly by external script.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:18 +02:00
Philippe Guibert
077c07cc58 zebra: storage of gre information in zebra layer
zebra is able to get information about gre tunnels.
zebra_gre file is created to handle hooks, but is not yet used.
also, debug zebra gre command is done to add gre traces.
A zebra_gre file is used for complementary actions that may be needed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 10:33:15 +02:00
Donatas Abraitis
c8b506e94f
Merge pull request #8569 from Jafaral/doc-svi
doc: add evpn discussion of svi and arp cache
2021-04-30 11:20:41 +03:00
Philippe Guibert
357b150dae zebra: at startup, fix links on all namespaces
when zebra has vrf backend mapped to namespaces, the polling
of interfaces leads to fix all linkages of interfaces. This
was not done on non default namespace. do it for other namespaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-30 08:05:01 +02:00
Philippe Guibert
ecffe9167b zebra: add the link interface information on interface updates
There are cases where either link information is not present at
interface creation or link information changed. handle this
situation.

Signed-off-by: Philippe.Guibert <philippe.guibert@6wind.com>

zebra dd link
2021-04-30 08:05:01 +02:00
Rafael Zalamena
c962ab93a8
Merge pull request #8570 from qlyoung/revert-ringbuf-readv
Revert "bgpd: improve socket read performance"
2021-04-29 18:32:52 -03:00
Olivier Dugeon
92e36a784a
Merge pull request #7789 from rgirada/fix_DR
ospfd: show ip ospf interface displays only BDR info, Added DR info.
2021-04-29 20:01:06 +02:00
Jafar Al-Gharaibeh
0a4e0034c8 doc: add evpn discussion of svi and arp cache
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-04-29 12:48:41 -05:00
Rafael Zalamena
5418880923
Merge pull request #7165 from qlyoung/fix-zapi-codec-badness
Fix zapi codec badness
2021-04-29 13:50:16 -03:00
Donald Sharp
6cbd4c830a
Merge pull request #8409 from rgirada/ospf-memleak
ospfd: Fixing few valgrind issues
2021-04-29 12:50:03 -04:00
Igor Ryzhov
6ad9bd4e1d
Merge pull request #8591 from mjstapp/fix_sharp_redist_lsp
sharpd: use correct list of redist protocols in remove lsp
2021-04-29 19:48:03 +03:00
Mark Stapp
2a3aac3d04
Merge pull request #8592 from donaldsharp/debug_cleanup
zebra: msgdump debug strangeness cleanup
2021-04-29 12:42:56 -04:00
Quentin Young
338f4a78cc bgpd: avoid allocating very large stack buffer
As pointed out on code review of BGP extended messages, increasing the
maximum BGP message size has the consequence of growing the dynamically
sized stack buffer up to 650K. While unlikely to exceed modern stack
sizes it is still unreasonably large. Remedy this with a heap buffer.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-29 12:12:32 -04:00
Quentin Young
6c55ee964e Revert "lib: add ringbuf socket read function"
This reverts commit d9d7af1a52.
2021-04-29 12:12:32 -04:00
Quentin Young
fe2e3bae6a Revert "bgpd: improve socket read performance"
This reverts commit 97a16e6481.
2021-04-29 12:12:32 -04:00
Igor Ryzhov
55ea3f2ec5
Merge pull request #8110 from rgirada/rmap_nb
lib: Routemap is not getting applied upon changing the routemap action
2021-04-29 17:29:55 +03:00
rgirada
4fc5dafd1c lib: Routemap is not getting applied upon changing the routemap action
Description:
	This looks broken after NB changes in routemap. When routemap
	action modified from permit to deny, it is expected to apply
	the new action on the filtered routes before the action in the
	routemap data structure has been changed. But currently this is
	not handled by the corresponding northbound API.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-04-29 17:23:37 +03:00
Mark Stapp
ca4681d151
Merge pull request #8559 from idryzhov/fix-printfrr-test-build
tests: fix build warning
2021-04-29 10:12:44 -04:00
Igor Ryzhov
f07572c3c7 isisd: move ldp-sync checks from cli to nb callbacks
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
b5c0a71b56 isisd: don't use operational data in "no isis circuit-type"
Use the config data instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
1457b1d5df isisd, yang: remove vrf leaf from isis interface node
This is very confusing and incorrect. We can and should use vrf leaf of
the interface itself instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
aaf8e80994 isisd: don't use operational data in "ip/ipv6 router isis"
Currently the operational data is used for two things:
- to inherit the is-type from the isis instance
- to set passive flag for loopback interfaces

This commit implements the first one using only the config data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
95018cdaa5 isisd: don't create instances directly from cli
This must be done only through NB code. The necessary change is enqueued
right on the next two lines.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
f2c170ce95 isisd: don't use operational data in "no router isis"
We need to delete isis config from interfaces when we delete the isis
router instance. This should be done using only config data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
25fe5b0fe8 isisd: remove useless checks from cli
is-type defaults to level-1-2 for more than a year already.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
ec62fbaa07 isisd: fix ldp-sync configuration
YANG model and CLI commands allow user to configure LDP-sync per area.
But the actual implementation is incorrect - all commands are changing
the config for the whole VRF instead of a single area. This commit fixes
this issue by actually implementing per area configuration.

Fixes #8578.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
bcf2208156 isisd: allow arbitrary order of area/interface configuration
Currently we don't allow to configure the interface before the area is
configured. This approach has the following issues:

1. The area config can be deleted even when we have an interface config
   relying on it. The code is not ready for that - we'll have a whole
   bunch of stale pointers if user does that.
2. The code doesn't correctly process the event of changing the VRF for
   an interface. There is no mechanism to ensure that the area exists
   in the new VRF so currently the circuit still stays in the old VRF.

This commit allows an arbitrary order of area/interface configuration.
There is no more need to configure the area before configuring the
interface.

This change fixes both the issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
0fdd8b2b11 isisd: update link params after circuit is up
Call from isis_circuit_create works only if we enable isis on an already
existing interface. If we configure isis on a pseudo interface and then
actually create it - this call doesn't work.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
e2b5b7d6d7 isisd: fix incorrect snmp-id gen/free
Necessary structures for snmp-id generation are currently stored in
`struct isis`. When we generate the new circuit ID, we always use the
instance from the default VRF. When we free the circuit ID, we use the
instance from the circuit VRF. This causes the following problems:

1. If there is no instance in the default VRF, this code doesn't work.
2. When circuit in non-default VRF is deleted, the ID is not actually
   freed.

This is fixed by using global structures instead. The code itself is
moved to isis_snmp.c and linked to the main code using hooks. We should
not call SNMP-related code when the SNMP module is not loaded at all.

More than that, we don't allow to activate the circuit if we failed to
generate the SNMP ID. Even if SNMP support is completely disabled! This
check is removed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
d3e3677096 bgpd: forbid modification of bgp instance type
If a user issues the following commands:
```
router bgp 65000 vrf red
router bgp 65000 view red
```
bgpd ends up having NB config inconsistent with actual data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 16:50:29 +03:00
Igor Ryzhov
debb7b1931 bgpd: simplify bgp_global_local_as_modify code
No need for complicated code to check instance existence.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 16:50:29 +03:00
Igor Ryzhov
0d6d0208a5 bgpd: fix crash when as/type mismatches in config
When we're trying to create the config for already existing router and
the AS number or instance type mismatches, we're returning the
inconsistency error and don't set the NB entry.

Any subsequent command that configures this router will crash because
every command relies on the existence of the NB entry.

Let's store the entry even when there's a mismatch to prevent the crash.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 16:50:29 +03:00
lynne
f44d0f5eca ospf6d: Make debug logs configurable to only display message headers
This change allows the user to only log the message header and not
include all the LSAs in each packet.   In a large setup printing out
all the LSAs in each packet can make the system very hard to debug.
When the user finds an issue with the adjacency not coming up or in a
specific packet type they can turn on a full dump of the message.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-04-29 08:40:34 -04:00
Donald Sharp
4d0773c4ea zebra: msgdump debug strangeness cleanup
a) `debug zebra kernel` turns off `debug zebra kernel msgdump....`
this is odd and bad

b) `debug zebra kernel msgdump send` turns off receive and vice versa
this is counter intuitive as well

c) `no zebra kernel msgdump ...` turns off all kernel level debugging
we should only turn off msgdump specific debugs

d) `no debug zebra kernel` turns off all kernel level debugging
we should leave msgdump on.

e) Fix `show run` and show debug output

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-29 08:22:53 -04:00
Mark Stapp
20c9e649be sharpd: use correct list of redist protocols in remove lsp
The remove lsp command was using the wrong list of route
protocols - use the ZEBRA list, same as the other clis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-29 08:15:08 -04:00
rgirada
2fbb8f4543 ospfd: show ip ospf interface only shows BDR info, Added DR info.
Description:
	DR information is missing under "show ip ospf interface [json]".
	Added DR infomation to display in "show ip ospf interface".

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-04-29 04:20:14 -07:00
Yash Ranjan
a49ef569de ospf6d: Change structure of "show ipv6 ospf6 route json" command
The output of "show ipv6 ospf6 route json" was not in the same
format as "show ip ospf route json". Currently ipv6 and ipv4 route
tables as well as ospfv2 have prefix as the key, but the same
is not true for ospfv3.

The structure of the json objects needs to be changed.

Currently the structure present is
frr(config-ospf6)# do show ipv6 ospf6 route json
{
  "routes":[
    {
      "destination":"66:ff::\/64",
      "isBestRoute":true,
      "destinationType":"N",
      "pathType":"IA",
      "duration":"00:00:06",
      "nextHops":[
        {
          "nextHop":"::",
          "interfaceName":"ens256"
        }
      ]
    }
  ]
}
It is changed to:
frr(config-ospf6)# do show ipv6 ospf6 route json
{
  "routes":{
    "12::2\/128":{
      "isBestRoute":true,
      "destinationType":"N",
      "pathType":"IA",
      "duration":"00:01:22",
      "nextHops":[
        {
          "nextHop":"::",
          "interfaceName":"ens192"
        }
      ]
    }
}

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-04-28 21:18:04 -07:00
Igor Ryzhov
faaa943137 tests: fix build warning
FMT_NSTD_BEGIN should be before the first use of "expr".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 03:28:04 +03:00
Quentin Young
ef456ea52e
Merge pull request #8586 from volta-networks/fix_openbsd_doc 2021-04-28 23:33:58 +00:00
Quentin Young
e70620f6a6
Merge pull request #8546 from ton31337/fix/add_markers_for_recent_bgpd 2021-04-28 19:51:28 +00:00