Commit Graph

30707 Commits

Author SHA1 Message Date
Donald Sharp
58cf0823bf bgpd: Add missing enum's to case statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 12:29:08 -05:00
Donald Sharp
ca411e386f lib: Add missing enum's to northbound.c
Some enums were missing for string conversions in northbound.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 12:29:08 -05:00
Donald Sharp
5c26054802 lib: Adding missing string to switch statement in mlag.c
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 12:29:08 -05:00
Donald Sharp
29763bc910 bgpd: ecommunity_token_rt6 is not handled
The function ecommunity_str2com_internal appears to want to handle
the ecommunity_token_rt6 enum but skips over it.  Commit
9a659715df 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-31 12:29:08 -05:00
Mark Stapp
3b337b7d27
Merge pull request #12687 from opensourcerouting/build-mkdir-p
build: consistently mkdir -p output for redirect
2023-01-31 11:28:32 -05:00
Mark Stapp
62f9428044
Merge pull request #12708 from donaldsharp/no_notification
zebra: Send nht resolved entry up to concerned protocols in all cases
2023-01-31 10:55:01 -05:00
Donald Sharp
ea768492f1
Merge pull request #12695 from opensourcerouting/format-warnings
build: `-Wformat-nonliteral -Wformat-security`
2023-01-31 09:01:32 -05:00
Donald Sharp
d829de9178
Merge pull request #12710 from opensourcerouting/fix/reset_fqdn_capability_on_before_handling_open
bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN
2023-01-31 08:46:03 -05:00
Donald Sharp
8c02dce8e9
Merge pull request #12711 from opensourcerouting/topotest-pid-fix
tests: Topotests fix for deleting wrong pidfile
2023-01-31 08:45:04 -05:00
Donald Sharp
8ce0e517ed zebra: Send nht resolved entry up to concerned protocols in all cases
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 06525c4f99
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-31 07:28:19 -05:00
Donatas Abraitis
9eca0bdc02
Merge pull request #12709 from donaldsharp/update_withdraw_always_work
bgpd: bgp_update and bgp_withdraw never return failures
2023-01-31 08:50:06 +02:00
Martin Winter
6c5045ce4f
tests: Topotests fix for deleting wrong pidfile
Fixes killRouterDaemons() function which occasionally deleted the wrong
pidfile.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-30 23:29:03 +01:00
Donatas Abraitis
d188b08f30 bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN
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-30 23:34:41 +02:00
Donatas Abraitis
17ff4f6367 bgpd: Free peer's hostname (aka FQDN capability stuff)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30 23:22:58 +02:00
Donatas Abraitis
5ca2a7e9e6 tests: Check if we vanish hostname/domainname if disabled from another side
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30 23:22:23 +02:00
Donald Sharp
367b458cb4 bgpd: bgp_update and bgp_withdraw never return failures
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-30 16:02:23 -05:00
Donatas Abraitis
65a78243d8
Merge pull request #12700 from taspelund/martian_tip_improvement
BGP Martian Tunnel-IP Improvements
2023-01-30 10:52:44 +02:00
Donatas Abraitis
e1da8b2500
Merge pull request #12703 from donaldsharp/basic_babel
Basic babel
2023-01-30 10:45:49 +02:00
Donald Sharp
d844d516da tests: Super simple babel test
Just get babel started and ensure that the v4 routes
are actually installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28 11:17:08 -05:00
Donald Sharp
6d078ff808 babeld: During intf startup, ignore address already in use
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-28 09:32:34 -05:00
Donald Sharp
403081e12a babeld: The function is already a pointer
Don't send the address of in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28 09:31:52 -05:00
Trey Aspelund
4dabdde32a bgpd: move tunnel-ip comparison into handler
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-27 11:12:14 -05:00
Trey Aspelund
826c3f6db3 bgpd: only unimport routes if tunnel-ip changes
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-27 11:11:44 -05:00
Donald Sharp
2d5928355c
Merge pull request #12690 from opensourcerouting/feature/deny_merging_prs_with_freeze_label
github: Prevent merging (fail CI) if 'freeze' label exists for PR
2023-01-27 07:43:02 -05:00
Donald Sharp
1646720fb5
Merge pull request #12691 from mjstapp/fix_dplane_prov_lock
zebra: fix SA warning, don't lock plugin list
2023-01-27 07:35:50 -05:00
David Lamparter
c2c6c55e8d build: enable format string warnings
I thought these were included in `-Wall -Wextra`, but apparently not.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter
d131cca998 bfdd: fix size_t format string
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter
0e4e879b40 bgpd: fix silly format string SNAFU
Someone thought vty_out accepts a list of strings.  It does not.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter
e678b143a9 bgpd: fix format string mess in AS-path printing
This was done *very* weirdly.  Make it slightly less so.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:20 +01:00
David Lamparter
e59bd527e9 lib: literal constant format string for termtable
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 12:01:20 +01:00
David Lamparter
ae08de9f42 *: fix non-const northbound XPath format strings
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 12:01:20 +01:00
David Lamparter
c84e518709 *: no-warn pragmas for non-const format strings
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 12:01:20 +01:00
David Lamparter
0f9de11a11 *: apply proper format string attributes
So that we get warnings about broken format strings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-27 12:01:17 +01:00
Donatas Abraitis
a2ec3f48ef
Merge pull request #12696 from donaldsharp/shadowed
Shadowed
2023-01-27 11:50:27 +02:00
Donald Sharp
8586a88abb lib: Remove global variable exposure struct host host
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-26 11:40:33 -05:00
Donald Sharp
9ca6d3db2b watchfrr: dmn variable shadows previous declaration
There is no need to declar the same temp variable 2 times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26 11:40:33 -05:00
Donald Sharp
75c87b7279 zebra: i declaration shadows other i declared
Clear up some confustion

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26 11:40:33 -05:00
Donald Sharp
08c3dba719 lib: Forward declaration of a struct does not need to have data type
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-26 11:40:33 -05:00
Rafael Zalamena
1596fa9c2f
Merge pull request #12694 from donaldsharp/zebra_rib_dead_code
remove dead code
2023-01-26 13:30:55 -03:00
Donald Sharp
e5a5e5388e lib: Remove dead code
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-25 15:45:39 -05:00
Donald Sharp
d2a174233b zebra: Remove impossible to use function
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>
2023-01-25 15:27:41 -05:00
Mark Stapp
6d5014b657 zebra: fix SA warning, don't lock plugin list
Locking around the list of providers/plugins is not
helpful - these only change at init time. Clear some SA
warnings by removing the locking.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-01-25 08:38:47 -05:00
Donatas Abraitis
c30461fc74
Merge pull request #12685 from louis-6wind/fix-vpnv4-noretain
topotests: fix bgp_vpnv4_noretain
2023-01-25 11:23:08 +02:00
Donatas Abraitis
a228215b00 github: Prevent merging (fail CI) if 'freeze' label exists for PR
Mostly useful duging the freeze period to warn the maintainers from merging
unwanted PRs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-25 10:43:55 +02:00
Donatas Abraitis
e6158ebe5d
Merge pull request #12660 from Pdoijode/ip-nht-json-changes
zebra: fix JSON fields for "show ip/ipv6 nht"
2023-01-25 10:32:18 +02:00
Donatas Abraitis
88bcd9f7ae
Merge pull request #12684 from chiragshah6/fdev2
bgpd: evpn route detail json display non prett
2023-01-25 10:30:10 +02:00
Pooja Jagadeesh Doijode
553c804846 zebra: fix JSON fields for "show ip/ipv6 nht"
1. Renamed "gates" to "nexthops"
2. Displaying afi of the nexthops being dispalyed in place of
   "nexthops" JSON object in the old JSON output
3. Calling show_route_nexthop_helper() and show_nexthop_json_helper()
   instead of print_nh() inorder to keeps the fields in "nexthops"
   JSON object in sync with "nexthops" JSON object of
   "show nexthop-group rib json".

Updated vtysh:
    r1# show ip nht
    192.168.0.2
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)
    192.168.0.4
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)

Updated JSON:
    r1# show ip nht json
    {
      "default":{
        "ipv4":{
          "192.168.0.2":{
            "nhtConnected":false,
            "clientList":[
              {
                "protocol":"static",
                "socket":28,
                "protocolFiltered":"none"
              }
            ],
            "nexthops":[
              {
                "flags":3,
                "fib":true,
                "directlyConnected":true,
                "interfaceIndex":2,
                "interfaceName":"r1-eth0",
                "vrf":"default",
                "active":true
              }
            ],
            "resolvedProtocol":"connected"
          }
        }
      }
    }

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-01-24 18:15:36 -08:00
Rafael Zalamena
9ffd15013a
Merge pull request #12680 from mjstapp/fix_dplane_lists
zebra: use typesafe lib lists in zebra dplane
2023-01-24 18:46:52 -03:00
Rafael Zalamena
21188a567a
Merge pull request #12670 from louis-6wind/fix-bfd-zclient
lib: do not reopen a zclient socket for bfd
2023-01-24 16:52:54 -03:00
David Lamparter
05a13c2cd4 yang: fix race condition in embedmodel.py mkdir
Parallel build may be executing another copy of embedmodel.py at the
same time, with both getting "False" on the isdir check, and then both
trying to mkdir - one of which will error out.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-24 18:19:18 +01:00