summaryrefslogtreecommitdiffstats
path: root/staticd/static_vrf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* staticd: fix NB dependency hackIgor Ryzhov2024-02-011-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, staticd configuration is tightly coupled with VRF existence. Because of that, it has to use a hack in NB infrastructure to create a VRF configuration when at least one static route is configured for this VRF. This hack is incompatible with mgmtd, because mgmtd doesn't execute configuration callbacks. Because of that, the configuration may become out of sync between mgmtd and staticd. There are two main cases: 1. Create static route in a VRF. The VRF data node will be created automatically in staticd by the NB hack, but not in mgmtd. 2. Delete VRF which has some static routes configured. The static route configuration will be deleted from staticd by the NB hack, but not from mgmtd. To fix the problem, decouple configuration of static routes from VRF configuration. Now it is possible to configure static routes even if the VRF doesn't exist yet. Once the VRF is created, staticd applies all the preconfigured routes. This change also fixes the problem with static routes being preserved in the system when staticd "control-plane-protocol" container is deleted but the VRF is still configured. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: cleanup ifp->vrf_idIgor Ryzhov2021-11-221-1/+0
| | | | | | | Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* tests: add grpc unit testChristian Hopps2021-06-061-0/+8
| | | | | | | | Test uses staticd which required some C++ header protections. Additionally, the test also runs in the ubuntu20 docker container as grpc is supported there by the packaging system. Signed-off-by: Christian Hopps <chopps@labn.net>
* *: modify VRF_CONFIGURED flag only in VRF NB layerIgor Ryzhov2021-03-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to fix the crash reproduced by the following steps: * ip link add red type vrf table 1 Creates VRF. * vtysh -c "conf" -c "vrf red" Creates VRF NB node and marks VRF as configured. * ip route 1.1.1.0/24 2.2.2.2 vrf red * no ip route 1.1.1.0/24 2.2.2.2 vrf red (or similar l3vni set/unset in zebra) Marks VRF as NOT configured. * ip link del red VRF is deleted, because it is marked as not configured, but NB node stays. Subsequent attempt to configure something in the VRF leads to a crash because of the stale pointer in NB layer. Fixes #8357. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* staticd: fix nexthop creation and installationIgor Ryzhov2021-02-171-1/+0
| | | | | | | | | | | | Currently, staticd creates a VRF for the nexthop it is trying to install. Later, when this nexthop is deleted, the VRF stays in the system and can not be deleted by the user because "no vrf" command doesn't work for this VRF because it was not created through northbound code. There is no need to create the VRF. Just set nh_vrf_id to VRF_UNKNOWN when the VRF doesn't exist. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* staticd : Configuration northbound implementationvdhingra2020-07-161-0/+10
| | | | | | | | | 1. Modifies the data structs to make the distance, tag and table-id property of a route, i.e created a hireachical data struct to save route and nexthop information. 2. Backend northbound implementation Signed-off-by: VishalDhingra <vdhingra@vmware.com>
* staticd: Fixing memory leak issuergirada2020-03-081-0/+1
| | | | | | | Memory allotted for staticd specific vrf structers is not being deallocated when the corresponding vrf is destroyed. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* staticd: Code review comments fixesDonald Sharp2018-07-291-8/+8
| | | | | | | 1) Conform staticd to proper gnu gpl file format. 2) Fix a spelling mistake found. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* staticd: Start the addition of a staticdDonald Sharp2018-07-291-0/+38
This is the start of separating out the static handling code from zebra -> staticd. This will help simplify the zebra code and isolate static route handling to it's own code base. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>