Commit Graph

30881 Commits

Author SHA1 Message Date
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
feba3f15d1 debian: merge changelogs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-24 18:19:42 +01:00
David Lamparter
e01401981c debian: point watch file at git tarball
The tar.xz dist tarball doesn't exist for new releases.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5a1130213c)
2023-01-24 18:19:42 +01:00
David Lamparter
1f3788f91d debian: frickel a working debian/watch file
Github changed the HTML for their releases tab, making download links a
javascript thing.  Which does not jive with uscan... at all...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3c185cf70c)
2023-01-24 18:19:42 +01:00
David Lamparter
a6f1545352 debian: fiddle with lintian spellcheck overrides
Apparently now the binary filename is after the item...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit f032ce0a66)
2023-01-24 18:19:42 +01:00
David Lamparter
0322a9d024 debian: fix python3 shebang in new files
Already done for existing python scripts in the install, just need to
add new .py files.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 03cef39003)
2023-01-24 18:19:42 +01:00
David Lamparter
5696a6a864 debian: remove bogus "iproute" dependency
This is cargo cult from decades ago.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 75a7532a11)
2023-01-24 18:19:42 +01:00
Ondřej Surý
0f0542210e debian: remove unused debian/watchfrr.rc file
The debian/watchfrr.rc file was not install, so we just remove the cruft.

Signed-off-by: Ondřej Surý <ondrej@sury.org>
(cherry picked from commit 5632ff61df)
2023-01-24 18:19:42 +01:00
David Lamparter
76827ba57e debian: fix texinfo figure installation directory
As pointed out by lintian.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b62f9af6b6)
2023-01-24 18:19:42 +01:00
David Lamparter
3a42c62d81 debian: fix sphinx docs
- use dh_sphinxdoc to get rid of embedded JS

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit e1e2ea84ee)
2023-01-24 18:19:42 +01:00
David Lamparter
abc5653c9a debian: fix cross-build marks (libelf/libpython3)
These two build-deps are for compile-time tools and thus need to be
marked :native.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit e9f0af06c9)
2023-01-24 18:19:42 +01:00
David Lamparter
a3591eaefa debian: make cross-compile work
This allows e.g. "sbuild --host=arm64" to build packages for other
architectures on, say, fat amd64 servers.  As a side effect, the Debian
build uses a separate builddir, which helps noting issues on that front.

Signed-off-by: David Lamparter <equinox@diac24.net>
(cherry-picked from commit d1312e009b)
2023-01-24 18:19:42 +01: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
David Lamparter
d173381edc build: consistently mkdir -p output for redirect
When running the build in a separate build directory, redirecting output
into a file can error out if the directory does not exist yet.  Some
places already had `mkdir -p` calls, but not all.

Make all occurences of this consistently use `@$(MKDIR_P)`.

(Extension of PR #12575 to catch more places.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-24 17:46:57 +01:00
David Lamparter
e784f789fb
Merge pull request #12575 from anlancs/fix/build-vtysh-missing-dir 2023-01-24 17:40:55 +01:00
Russ White
9b1b028cc2
Merge pull request #12682 from opensourcerouting/time-cs
*: fix time truncation in many places
2023-01-24 10:51:44 -05:00
Russ White
b25695f630
Merge pull request #12678 from opensourcerouting/fix/missing_no_form_for_path_attribute_discard
bgpd: Add missing `no` form for `neighbor path-attribute discard` cmd
2023-01-24 10:45:03 -05:00
Russ White
1ea7c32507
Merge pull request #12634 from anlancs/fix/lib-seq-adjust-return-value
lib: fix wrong returned value for filter
2023-01-24 10:36:17 -05:00
Russ White
4261bddcbb
Merge pull request #12640 from vfreex/babel-no-commands
babeld: Add missing `no` commands
2023-01-24 10:33:24 -05:00
Russ White
9cff2d526e
Merge pull request #10405 from kanaya516/feature/adj-sid-yang
isisd: yang for adjacency-sid and lan-adjacency-sid
2023-01-24 10:26:07 -05:00
Russ White
95e5cc2319
Merge pull request #12647 from anlancs/fix/bgpd-type-2
bgpd: cosmetic changes for debug
2023-01-24 10:13:22 -05:00
Louis Scalbert
f6e7fbdae9 lib: remove concurrent nexthop zapi (un)registration
Daemons like staticd already implement nexthop zapi (un)registration.
b7ca809d1c ("lib: BFD automatic source selection") has implemented a
concurrent nexthop (un)registration. Some nexthop could be unregistred
by the bfd whereas they were still needed by the daemon.

Let the deamons deal with nexthop zapi (un)registration.

Fixes: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-01-24 16:08:26 +01:00
Louis Scalbert
a77ea81ef3 lib: do not reopen a zclient socket for bfd
b7ca809d1c ("lib: BFD automatic source selection") has added a dedicated
zclient socket for nht tracking. Since the bfd lib is used by daemons
that already has a zclient socket, those daemons has now a second
zclient socket. However, zebra does not distinguish the two zclient
sessions. For example, the interfaces are asked a second via
zebra_message_send(zclient, ZEBRA_INTERFACE_ADD, VRF_DEFAULT) in
zclient_start(). As a result, callbacks functions like bgp_ifp_create()
are called a second time, which causes some processing overhead and
might cause bugs.

Re-use the existing zclient socket for nht tracking.

Note that BFD automatic source selection is only currently implemented
in staticd. Other daemons will require to add the following in their
ZEBRA_NEXTHOP_UPDATE callback function:

> 	if (zclient->bfd_integration)
>		bfd_nht_update(&matched, &nhr);

Fixes: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-01-24 16:08:04 +01:00
Donatas Abraitis
1983a80dd6
Merge pull request #12681 from pguibert6WIND/vpnv6_encode_plus
Vpnv6 encode plus
2023-01-24 14:47:58 +02:00
Louis Scalbert
6c13bd5744 topotests: fix bgp_vpnv4_noretain
Fix the following issues:
- two tests are done in one function. Dispatch the tests in two
functions to help the test debug.
- the first test passes even if a third prefix is not filtered. Match
the exact to avoid false positive.
- the expected values contains variable like version. Do no check
variable values.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-01-24 10:20:19 +01:00
Donatas Abraitis
e80ae3ec62
Merge pull request #12679 from spk-hebbar/master
zebra_fpm: Add support for other protocols in fpm:netlink
2023-01-24 10:01:55 +02:00
Philippe Guibert
9795e9f234 bgpd: fix when route-map changes the link local nexthop for vpnv6
This fix updates the nexthop length of a bgp update to be
transmitted to a remote peer. Before the previous commit,
the ipv6 nexthop length was internally set to 32 bytes which
was not correct, as it should be 48 bytes which is conform
to the vpnv6 encoding format.

However, without the previous match, even if internally, the
nexthop length was set to 32, the real nexthop length was set
to 48 bytes, and everything was operating ok.

Now, if we use the following route-map, and attach it to
outgoing for vpnv6 address family, then we have a malformed
packet detected, and the peering breaks.

 > route-map rmap permit 1
 > set ipv6 next-hop global 5:5::3:6
 > set ipv6 next-hop local fe80:55::333:222

Maintain the mp_nexthop_len to 48 bytes if it was already set
to 48 previously.

Fixes: 35ac9b53f2 ("bgpd: fix vpnv6 nexthop encoding")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-01-24 08:04:27 +01:00
Chirag Shah
3cdb03fba7 bgpd: evpn route detail json display non prett
For BGP evpn route table detail json to use
non pretty form of display.

Problem:
In scaled evpn route table detail json dump
occupies high resources (CPU + memory) of the system.
In high scale evpn route dump using pretty form
hogs CPU for a while which can trigger watchfrr
to kill bgpd.

Solution:
Avoid pretty JSON print for detail version dump

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-01-23 22:25:12 -08:00
mobash-rasool
c6188284fb
Merge pull request #12677 from opensourcerouting/fix/ospf_potential_memory_leak
ospfd: Free memory for JSON allocated object before return
2023-01-24 09:54:44 +05:30
Spoorthi K
4a563f2714 zebra_fpm: Add support for other protocols in fpm:netlink
fpm:netlink format doesn't indicate the protocol information
    in routes of BGP, OSPF and other protocols. Routes of those
    protocols just indicate protocol as zebra.

    The below route is actually BGP route but 'proto': 11
    indicates that it is zebra.

    {'attrs': [('RTA_DST', 'dummy'),
               ('RTA_PRIORITY', 0),
               ('RTA_GATEWAY', 'dummy'),
               ('RTA_OIF', 2)],
     'dst_len': 32,
     'family': 2,
     'flags': 0,
     'header': {'flags': 1025,
                'length': 60,
                'pid': 3160253895,
                'sequence_number': 0,
                'type': 24},
     'proto': 11,
     'scope': 0,
     'src_len': 0,
     'table': 254,
     'tos': 0,
     'type': 1}

    with this change it is now seen with 'proto': 186
    indicates that it is BGP.

    {'attrs': [('RTA_DST', 'dummy'),
               ('RTA_PRIORITY', 0),
               ('RTA_GATEWAY', 'dummy'),
               ('RTA_OIF', 2)],
     'dst_len': 32,
     'family': 2,
     'flags': 0,
     'header': {'flags': 1025,
                'length': 60,
                'pid': 3160253895,
                'sequence_number': 0,
                'type': 24},
     'proto': 186,
     'scope': 0,
     'src_len': 0,
     'table': 254,
     'tos': 0,
     'type': 1}

Signed-off-by: Spoorthi K <spk@redhat.com>
2023-01-24 09:48:21 +05:30
Philippe Guibert
f7a0eb6a17 bgpd: encode properly vpnv6 nexthop
This change updates the nexthop attribute length
accordingly to the safi used. Actually, with the
previous commit, the length calculated was not
aligned with the real nexthop length. Such packet
received by remote peer was malformed, and this
was resulting in breaking vpnv6 peering.

Fix this by updating appropriately the real
nexthop length.

Fixes: 35ac9b53f2 ("bgpd: fix vpnv6 nexthop encoding")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-01-23 16:43:51 +01:00
Mark Stapp
ac96497ccc zebra: use typesafe lib lists in zebra dplane
Replace some of the old queue/DLIST macros with typesafe
dlists.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-01-23 08:55:44 -05:00
Donatas Abraitis
88c5852b72 ospfd: Free memory for JSON allocated object before return
For show_ip_ospf_database_type_adv_router_common().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-23 13:46:42 +02:00
Rafael Zalamena
5d543b3fd2 isisd: fix time truncation on display
Use a larger storage to keep the `time_t` that is platform agnostic and
use the appropriated printing primitive.

Found by Coverity Scan (CID 1519793)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-01-23 08:16:39 -03:00
Donatas Abraitis
b986d7f41a bgpd: Add missing no form for neighbor path-attribute discard cmd
Just forgot this _somehow_ :)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-22 22:17:39 +02:00
Donatas Abraitis
de2e2d5ef0
Merge pull request #12673 from chiragshah6/fdev1
ospfd: fix crash show ip ospf border-routers json
2023-01-22 21:19:04 +02:00
Donatas Abraitis
cb2689d3e5 ospfd: Free memory for JSON allocated object before return
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-22 21:15:44 +02:00
Donatas Abraitis
a0adee8232
Merge pull request #12671 from vfreex/babel-fix-terminal
babeld: Fix --terminal option
2023-01-22 00:02:05 +02:00
Chirag Shah
1ffbb2e487 ospfd: fix crash show ip ospf border-routers json
When show ip ospf border-routers json (without vrf)
specificed, it leads to crash if there no border-routers
information.

Fix:
Do not free json object if use_vrf flag (means vrf option
is not passed) is not set.

Ticket:#3229017
Issue:3229017
Testing Done:

with fix:
l1# show ip ospf border-routers json
{
}
l1# show ip ospf vrf default border-routers json
{
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-01-20 23:24:44 -08:00
Yuxiang Zhu
9affd46417 babeld: Add missing no commands
Some babeld commands doesn't have the corresponding negative commands
defined, so those commands doesn't work with frr-reload.py.

This PR adds those missing commands.

Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2023-01-21 03:33:03 +08:00
Rafael Zalamena
23acae3b87 bgpd: fix time truncation due to parameter type
Use the correct function parameters type to avoid truncation and other
signal issues.

Found by Coverity Scan (CID 1519802)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-01-20 16:20:56 -03:00