summaryrefslogtreecommitdiffstats
path: root/zebra/ipforward.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-02-06bgpd: Add more context in logs about from where to where routes are leakedDonatas Abraitis1-2/+6
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-06bgpd: Drop struct bgp from vpn_leak_to_vrf_withdraw()Donatas Abraitis3-15/+11
Not used at all, just drop it. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-06tests: Check if `route-map vpn import` basic funtionality works fineDonatas Abraitis4-0/+188
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-06babeld: Fix filtering against all interfacesYuxiang Zhu1-2/+5
The first argument of `access_list_lookup` and `prefix_list_lookup` should be `AFI_` constants instead of `AF_` constants. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2023-02-02bgpd: Don't try to recursively hold peer io mutexDonald Sharp1-6/+7
BGP was modified in a0b937de428e14e869b8541f0b7810113d619c2e to grab the peer->io_mtx before validating the header to ensure that the input Queue was not being modified by anyone else at that moment in time. Unfortunately validate_header can detect a problem and attempt to relock the mutex, which deadlocks. This deadlock in the bgp_io pthread is the lone deadlock at first, eventually though bgp attempts to write another packet to the peer( say when the it's time to send the next packet ) and the main pthread of bgpd becomes deadlocked and then the whole bgpd process is stuck at that point in time leaving us dead in the water. The point of locking the mutex earlier was to ensure that the input Queue wasn't being modified by anyone else, (Say reading off it ) as that we wanted to ensure that we don't hold more packets then necessary. Let's grab the mutex long enough to look at the input Q size, this ensure that we have room and then we can validate_header and do the right thing from there. We'll need to lock the mutex when we actually move it into the input Q as well. Fixes: #12725 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-02bgpd: Convert evpn output to not pretty print jsonDonald Sharp1-8/+7
Commit: 3cdb03fba7b40240fb38469a12b7b05a11043e09 changed the vty_json output to not be pretty printing. The previous commit in the tree added vty_json_no_pretty let's use that instead Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-02lib, bgpd: Add ability to specify that some json output should not be prettyDonald Sharp3-2/+28
Initial commit: 23b2a7ef524c9fe083b217c7f6ebaec0effc8f52 changed the json output of `show bgp <afi> <safi> json` to not have pretty print because when under a situation where there are a bunch of routes with a large scale ecmp show output was taking forever and this commit cut 2 minutes out of vtysh run time. Subusequent commit: f4ec52f7cc99f709756d9030623a20c98a086125 changed this back. When upgrading to latest version the long run time was noticed due to testing. Let's add back this functionality such that FRR can have reduced run times with vtysh when it's really needed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-01bgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdrawDonatas Abraitis1-1/+2
Before this patch, we always passed `struct attr` for NLRI_UPDATE, but if we have a situation with treat-as-withdraw (for example: malformed attribute, or using a command like `neighbor path-attribute treat-as-withdraw`) the route MUST be withdrawn form the BGP table. Hence, we MUST pass attr as NULL, in this case we already have this check under NLRI_ATTR_ARG() macro, just reuse it properly. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-01vtysh: Schedule shell access for deprecationDonald Sharp2-1/+5
Schedule shell access for deprecation and removal in a years time. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-01tests: add missing printf attributeDavid Lamparter1-0/+1
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01tests: yank asprintfrr duplicateDavid Lamparter1-65/+43
I think this one predates the existence of asprintfrr. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01lib: fix one more b0rked format stringDavid Lamparter1-1/+1
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01bgpd/rfapi: add missing printf attributeDavid Lamparter1-1/+2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01lib: apply more `printf` attributesDavid Lamparter2-4/+7
... missed some functions in the earlier commits :( Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31tools: add GotoXref vim scriptDavid Lamparter1-0/+41
Let's make these unique IDs actually a bit useful. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31bgpd: ecommunity_token_rt6 is not handledDonald Sharp1-1/+1
The function ecommunity_str2com_internal appears to want to handle the ecommunity_token_rt6 enum but skips over it. Commit 9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081 tried to add this but I really don't see how this is going to behave correctly. Add the ecommunity_token_rt6 case to the switch statement so it is handled appropriately? Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31tests: Use JSON camelCase naming for testsDonatas Abraitis27-326/+326
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31tests: Fix wrong tgen.stop_topology() calls which got skippedMartin Winter4-4/+4
Calls were missing the () and caused the stop_topology() to be skipped Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-31tests: zebra_rib remove a sleepDonald Sharp1-1/+10
The test was sometimes failing around the sleep(4) for waiting for the routes to be installed. Instead of blindly sleeping let's check to see that the routes are actually there in zebra and then continue on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31zebra: Send nht resolved entry up to concerned protocols in all casesDonald Sharp1-3/+6
There existed the idea, from Volta, that a nexthop group would not have the same nexthops installed -vs- what FRR actually sent down. The dplane would notify you. With the addition of 06525c4f99d4dcafdf448565f7e11bd70993697d the code was put behind a bit of a wall controlled the usage of it. The flag ROUTE_ENTRY_USE_FIB_NHG flag was being used to control which set was being sent up to concerned parties in nexthop tracking. Put this flag behind the wall and do not necessarily set it when we receive a data plane notification about a route being installed or not. Fixes: #12706 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31doc: Define why my pull request was closedDonatas Abraitis1-0/+14
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31doc: Add a documentation about commit conventionsDonatas Abraitis1-0/+13
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31tools: Add commit linterDonatas Abraitis2-0/+63
Run under Github Actions, and restrict commit messages, structure, with, etc. Enforce using only our specified prefixes for commit messages. It reduces the work release managers do when _crafting_ release notes. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31doc: Write a short introduction about squashing commitsDonatas Abraitis1-0/+13
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31*: Drop deprecated incorrect JSON fields with wrong namingDonatas Abraitis9-146/+4
Deprecation cycle already passed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30tests: Topotests fix for deleting wrong pidfileMartin Winter1-5/+6
Fixes killRouterDaemons() function which occasionally deleted the wrong pidfile. Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-30bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPENDonatas Abraitis1-10/+8
Before this, if the peer disables sending FQDN capability, the old hostname still (STALE) exists and is misleading in the outputs of `show bgp ...`. Especially when using with `bgp default show-hostname`, etc. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30bgpd: Free peer's hostname (aka FQDN capability stuff)Donatas Abraitis1-0/+1
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30tests: Check if we vanish hostname/domainname if disabled from another sideDonatas Abraitis3-12/+93
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30bgpd: bgp_update and bgp_withdraw never return failuresDonald Sharp6-138/+89
These two functions always return 0. As such any and all tests against this make no sense. Remove the return 0 to a void and follow the chain, logically, to remove all the dead code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-30pimd: v6 intentionally turned off route-maps. Turn it on.Donald Sharp1-1/+1
Why? Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28tests: Super simple babel testDonald Sharp10-0/+539
Just get babel started and ensure that the v4 routes are actually installed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28babeld: During intf startup, ignore address already in useDonald Sharp1-9/+9
When listening on a multicast group. No need to actually fail the operation when it's already being used. Let's not treat the Address already in use error message as one that is stopping everything from working. Especially since multiple interface events cause this to happen. Without this, if config is read in before full connection to zebra, babel will never establish neighbors. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28babeld: The function is already a pointerDonald Sharp1-1/+1
Don't send the address of in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-27bgpd: move tunnel-ip comparison into handlerTrey Aspelund1-6/+8
Moves the old/new IP comparison into handle_tunnel_ip_change instead of expecting the caller to do the check on their own. Also changes handle_tunnel_ip_change to return void since it only ever returned 0 in all cases. Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2023-01-27bgpd: only unimport routes if tunnel-ip changesTrey Aspelund3-11/+32
When processing a new local VNI, we were always walking the global EVPN table to look for routes that needed to be removed due to a martian nexthop change (specifically a tunnel-ip change). Since the martian TIP table is global (all VNIs) + the walk is also in the global table (all VNIs), we can trust that any new TIP from any VNI would result in routes getting removed from the global table and unimported from all live (L2)VNIs. i.e. The only time this update is actionable is if we are adding/removing an IP from the martian TIP table, and we do not need to walk the table for normal refcount adjustments. Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2023-01-27build: enable format string warningsDavid Lamparter1-0/+2
I thought these were included in `-Wall -Wextra`, but apparently not. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27bfdd: fix size_t format stringDavid Lamparter1-1/+1
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27bgpd: fix silly format string SNAFUDavid Lamparter1-2/+2
Someone thought vty_out accepts a list of strings. It does not. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27bgpd: fix format string mess in AS-path printingDavid Lamparter3-14/+9
This was done *very* weirdly. Make it slightly less so. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27lib: literal constant format string for termtableDavid Lamparter1-5/+4
While this wasn't a problematic use of a format string, make it a literal constant so the compiler is happy. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27*: fix non-const northbound XPath format stringsDavid Lamparter9-41/+36
Passing a pre-formatted buffer in these places needs a `"%s"` in front so it doesn't get formatted twice. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27*: no-warn pragmas for non-const format stringsDavid Lamparter9-0/+66
We do use non-constant/literal format strings in a few places for more or less valid reasons; put `ignored "-Wformat-nonliteral"` around those so we can have the warning enabled for everywhere else. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27*: apply proper format string attributesDavid Lamparter13-53/+87
So that we get warnings about broken format strings. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-26lib: Remove global variable exposure `struct host host`Donald Sharp2-5/+2
This was only used in one place and we have accessor functions now. So let's use them. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26watchfrr: dmn variable shadows previous declarationDonald Sharp1-7/+4
There is no need to declar the same temp variable 2 times. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26zebra: i declaration shadows other i declaredDonald Sharp1-4/+5
Clear up some confustion Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26lib: Forward declaration of a struct does not need to have data typeDonald Sharp1-1/+1
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-25lib: Remove dead codeDonald Sharp2-25/+0
wheel_stop and wheel_start have never been used. Let's just remove them. After close to 7 years, if needed someone else can add back in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-25zebra: Remove impossible to use functionDonald Sharp1-25/+1
The rib_update_handle_vrf function is no longer being used. Cleanup it's usage from zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com>