]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
19 months agoMerge pull request #14465 from donaldsharp/zebra_snmp_coverity
Mark Stapp [Thu, 21 Sep 2023 17:21:10 +0000 (13:21 -0400)]
Merge pull request #14465 from donaldsharp/zebra_snmp_coverity

zebra: Fix longstanding snmp coverity issue

19 months agozebra: Fix longstanding snmp coverity issue
Donald Sharp [Thu, 21 Sep 2023 12:45:27 +0000 (08:45 -0400)]
zebra: Fix longstanding snmp coverity issue

The value is not being treated correctly, make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14453 from pguibert6WIND/isis_startup_crash
Donald Sharp [Thu, 21 Sep 2023 10:33:16 +0000 (06:33 -0400)]
Merge pull request #14453 from pguibert6WIND/isis_startup_crash

isisd: fix crash when configuring srv6 locator without isis instance

19 months agoMerge pull request #14454 from opensourcerouting/coverity-20230920
Donald Sharp [Thu, 21 Sep 2023 10:31:58 +0000 (06:31 -0400)]
Merge pull request #14454 from opensourcerouting/coverity-20230920

lib: fix a bunch of coverity nits

19 months agoMerge pull request #14455 from fdumontet6WIND/fix_coverity_as_path
Donatas Abraitis [Thu, 21 Sep 2023 06:21:52 +0000 (09:21 +0300)]
Merge pull request #14455 from fdumontet6WIND/fix_coverity_as_path

bgpd: fix coverity issue on aspath_filter_exclude_acl

19 months agoMerge pull request #14089 from dmytroshytyi-6WIND/srv6_multiple_segs_sids
Russ White [Thu, 21 Sep 2023 03:09:35 +0000 (23:09 -0400)]
Merge pull request #14089 from dmytroshytyi-6WIND/srv6_multiple_segs_sids

 bgpd,doc,lib,sharpd,staticd,yang,zebra: SRv6 multiple segs SIDs

19 months agobgpd: fix coverity issue on aspath_filter_exclude_acl
Francois Dumontet [Wed, 20 Sep 2023 15:26:12 +0000 (17:26 +0200)]
bgpd: fix coverity issue on aspath_filter_exclude_acl

CID 1566378 (#1-4 of 4): Use after free (USE_AFTER_FREE)76.
use_after_free: Using freed pointer cur_seg.

now the prev_seg pointer is set with always existaing values.

Link: https://scan7.scan.coverity.com/reports.htm#v39104/p13747/fileInstanceId=146858993&defectInstanceId=18968273&mergedDefectId=1566378&fileStart=1376&fileEnd=1625
Fixes: 4685db418e3a861205a28f975afeb9869f674337 (bgpd: add set as-path exclude acl-list command)
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
19 months agoMerge pull request #14452 from opensourcerouting/fix/coverity_issues
Donald Sharp [Wed, 20 Sep 2023 16:04:05 +0000 (12:04 -0400)]
Merge pull request #14452 from opensourcerouting/fix/coverity_issues

Some recent coverity fixes

19 months agolib: random make-coverity-happy nits
David Lamparter [Wed, 20 Sep 2023 13:27:23 +0000 (15:27 +0200)]
lib: random make-coverity-happy nits

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoisisd: fix crash when configuring srv6 locator without isis instance
Philippe Guibert [Wed, 20 Sep 2023 11:58:29 +0000 (13:58 +0200)]
isisd: fix crash when configuring srv6 locator without isis instance

After the ISIS daemon is launched, the configuration of an srv6
locator in zebra triggers a crash:

> #4  0x00007f1f0ea980f3 in core_handler (signo=11, siginfo=0x7ffdb750de70, context=0x7ffdb750dd40)
>     at /build/make-pkg/output/_packages/cp-routing/src/lib/sigevent.c:262
> #5  <signal handler called>
> #6  0x00005651a05783ef in isis_zebra_process_srv6_locator_add (cmd=117, zclient=0x5651a21d9bd0, length=25, vrf_id=0)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_zebra.c:1258
> #7  0x00007f1f0ead5ac9 in zclient_read (thread=0x7ffdb750e750) at /build/make-pkg/output/_packages/cp-routing/src/lib/zclient.c:4246
> #8  0x00007f1f0eab19d4 in thread_call (thread=0x7ffdb750e750) at /build/make-pkg/output/_packages/cp-routing/src/lib/thread.c:1825
> #9  0x00007f1f0ea4862e in frr_run (master=0x5651a1f65a40) at /build/make-pkg/output/_packages/cp-routing/src/lib/libfrr.c:1155
> #10 0x00005651a051131a in main (argc=5, argv=0x7ffdb750e998, envp=0x7ffdb750e9c8)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_main.c:282
> (gdb) f 6
> #6  0x00005651a05783ef in isis_zebra_process_srv6_locator_add (cmd=117, zclient=0x5651a21d9bd0, length=25, vrf_id=0)
>     at /build/make-pkg/output/_packages/cp-routing/src/isisd/isis_zebra.c:1258
> (gdb) print isis
> $1 = (struct isis *) 0x0
> (gdb) print isis->area_list
> Cannot access memory at address 0x28

The isis pointer is NULL, because no instances have already been
configured on the ISIS instance.
Fix this by checking that there is any isis instance available when
zebra hooks related to srv6 are received.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agotests: add srv6 multiple segs SIDs topotest
Dmytro Shytyi [Fri, 21 Jul 2023 12:19:20 +0000 (14:19 +0200)]
tests: add srv6 multiple segs SIDs topotest

Configure and verify the installed srv6 route with multiple segs SIDs

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agostaticd: add vtysh srv6 multiple segs SIDs
Dmytro Shytyi [Wed, 26 Jul 2023 16:44:23 +0000 (18:44 +0200)]
staticd: add vtysh srv6 multiple segs SIDs

Append staticd vty with multiple segs SIDs.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agostaticd: northbound srv6 hooks for segs stack yang model
Dmytro Shytyi [Wed, 26 Jul 2023 16:01:20 +0000 (18:01 +0200)]
staticd: northbound srv6 hooks for segs stack yang model

Provive hooks for srv6 segs SIDs stack yang model.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agostaticd: zebra, modify nexthop to support multiple srv6 segs SIDs
Dmytro Shytyi [Wed, 26 Jul 2023 16:00:17 +0000 (18:00 +0200)]
staticd: zebra, modify nexthop to support multiple srv6 segs SIDs

Adapt the nexthop from 1 to multiple srv6 seg SIDs

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agostaticd: add srv6 static route seg information
Dmytro Shytyi [Wed, 26 Jul 2023 16:43:51 +0000 (18:43 +0200)]
staticd: add srv6 static route seg information

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agozebra: add northbound api hooks for nexthop segments
Dmytro Shytyi [Wed, 26 Jul 2023 15:58:03 +0000 (17:58 +0200)]
zebra: add northbound api hooks for nexthop segments

Provide skeleton hooks for nexthop segments
Those hooks address seg6 segs stack entries defined in the YANG
model

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agoyang: provide a yang model for seg6 segs SIDs stack
Dmytro Shytyi [Wed, 26 Jul 2023 15:59:36 +0000 (17:59 +0200)]
yang: provide a yang model for seg6 segs SIDs stack

Add seg6 segs SIDs stack into frr-nexhop.yang file.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agolib: adapt nexthop_cmp to handle multiple segs SIDs
Dmytro Shytyi [Thu, 27 Jul 2023 09:40:22 +0000 (11:40 +0200)]
lib: adapt nexthop_cmp to handle multiple segs SIDs

Extend nexthop_cmp function to process multiple segs
SIDs.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agolib: update del_srv6_seg6_local to handle seg6_segs
Dmytro Shytyi [Thu, 3 Aug 2023 16:35:53 +0000 (18:35 +0200)]
lib: update del_srv6_seg6_local to handle seg6_segs

Adapt de_srv6_seg6local to handle seg6_segs structure.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agolib: nexthop, free the multiple seg6_segs
Dmytro Shytyi [Thu, 3 Aug 2023 14:20:47 +0000 (16:20 +0200)]
lib: nexthop, free the multiple seg6_segs

Adapt the function that fees srv6 nexthop to handle multiple segs.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agolib: in nexthop adaptation pass the number of segs to jhash
Dmytro Shytyi [Thu, 3 Aug 2023 14:12:04 +0000 (16:12 +0200)]
lib: in nexthop adaptation pass the number of segs to jhash

Adapt nexthop file to handle hash of multiple segments

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agobgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthop
Dmytro Shytyi [Wed, 26 Jul 2023 15:56:32 +0000 (17:56 +0200)]
bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthop

Append zebra and lib to use muliple SRv6 segs SIDs, and keep one
seg SID for bgpd and sharpd.

Note: bgpd and sharpd compilation relies on the lib and zebra files,
i.e if we separate this: lib or zebra or bgpd or sharpd in different
commits - this will not compile.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agodoc: srv6 multiple segs SIDs documentation
Dmytro Shytyi [Wed, 26 Jul 2023 15:46:31 +0000 (17:46 +0200)]
doc: srv6 multiple segs SIDs documentation

Provide a paragraph for srv6 multiple segs SIDs in documentation
to describe the multiple segs functionality.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
19 months agolib: clippy ELF: check existence of string table
David Lamparter [Wed, 20 Sep 2023 12:49:22 +0000 (14:49 +0200)]
lib: clippy ELF: check existence of string table

Mostly to make coverity happy, no compiler/linker should produce broken
ELF files like this (and if it does we can't process it anyway...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agolib: straight return on error on log open fail
David Lamparter [Wed, 20 Sep 2023 12:46:10 +0000 (14:46 +0200)]
lib: straight return on error on log open fail

I think I originally had some other code at the tail end of that
function, but that's not the case anymore, and dropping out of the
function with a straight "return -1" is more useful than trucking on
with an invalid fd.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agolib: add dup() error check in logging code
David Lamparter [Wed, 20 Sep 2023 12:35:55 +0000 (14:35 +0200)]
lib: add dup() error check in logging code

Mostly to make coverity happy, if dup() fails we're f*cked already.
(Still useful to have a better error message...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agostaticd: Check against NULL before dereferencing vrf
Donatas Abraitis [Wed, 20 Sep 2023 12:24:25 +0000 (15:24 +0300)]
staticd: Check against NULL before dereferencing vrf

If VRF is not found by the given name, validate it and return an error.

Fixes: 76b2bc97e738 ("staticd: Accept full blackhole typed keywords for ip_route_cmd")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Initialise prd despite if it's safi-related or not
Donatas Abraitis [Wed, 20 Sep 2023 12:05:35 +0000 (15:05 +0300)]
bgpd: Initialise prd despite if it's safi-related or not

Fixes: d33bd631262d60a7c0a2d56a2fe143bff45e32f0 ("bgpd: fix coverity issue in bgpd")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14448 from qlyoung/doc-add-northbound-api-docs
Mark Stapp [Wed, 20 Sep 2023 11:49:14 +0000 (07:49 -0400)]
Merge pull request #14448 from qlyoung/doc-add-northbound-api-docs

doc: add northbound api arch docs

19 months agoMerge pull request #14442 from mjstapp/fix_no_ctime
Donald Sharp [Wed, 20 Sep 2023 11:32:51 +0000 (07:32 -0400)]
Merge pull request #14442 from mjstapp/fix_no_ctime

bgpd, pathd: replace ctime() with ctime_r()

19 months agoMerge pull request #14440 from fdumontet6WIND/fix_oid_bgp4v2
Donatas Abraitis [Wed, 20 Sep 2023 06:58:58 +0000 (09:58 +0300)]
Merge pull request #14440 from fdumontet6WIND/fix_oid_bgp4v2

bgpd: fix  SNMP oid in bgp4v2

19 months agoMerge pull request #14445 from donaldsharp/use_my_cabbage
Donatas Abraitis [Wed, 20 Sep 2023 06:58:13 +0000 (09:58 +0300)]
Merge pull request #14445 from donaldsharp/use_my_cabbage

couple bgp coverity issues

19 months agodoc: add northbound api arch docs
Quentin Young [Wed, 20 Sep 2023 01:36:04 +0000 (21:36 -0400)]
doc: add northbound api arch docs

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
19 months agoMerge pull request #14443 from opensourcerouting/coverity-redux-20230919
Donald Sharp [Wed, 20 Sep 2023 00:01:45 +0000 (20:01 -0400)]
Merge pull request #14443 from opensourcerouting/coverity-redux-20230919

lib: constrain hash table "tabshift" both ways

19 months agoMerge pull request #14416 from donaldsharp/oil_parent_wrong
Donatas Abraitis [Tue, 19 Sep 2023 20:53:49 +0000 (23:53 +0300)]
Merge pull request #14416 from donaldsharp/oil_parent_wrong

pimd: Use a better name for oil_parent

19 months agotests: replace ctime with ctime_r
Mark Stapp [Tue, 19 Sep 2023 20:24:07 +0000 (16:24 -0400)]
tests: replace ctime with ctime_r

Replace ctime with ctime_r in bgp test.

Signed-off-by: Mark Stapp <mjs@labn.net>
19 months agopathd: replace ctime with ctime_r
Mark Stapp [Tue, 19 Sep 2023 17:15:55 +0000 (13:15 -0400)]
pathd: replace ctime with ctime_r

No ctime - replace with ctime_r()

Signed-off-by: Mark Stapp <mjs@labn.net>
19 months agobgpd: replace ctime with ctime_r
Mark Stapp [Tue, 19 Sep 2023 17:15:21 +0000 (13:15 -0400)]
bgpd: replace ctime with ctime_r

No ctime, use ctime_r.

Signed-off-by: Mark Stapp <mjs@labn.net>
19 months agobgpd: Make debug a passed in variable for bgp_evpn_path_info_cmp
Donald Sharp [Tue, 19 Sep 2023 19:51:05 +0000 (15:51 -0400)]
bgpd: Make debug a passed in variable for bgp_evpn_path_info_cmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Prevent use after free from coverity's perspective
Donald Sharp [Tue, 19 Sep 2023 19:48:57 +0000 (15:48 -0400)]
bgpd: Prevent use after free from coverity's perspective

Prevent a use after free from coverity's perspective.  A
bgp node may have been freed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: constrain hash table "tabshift" both ways
David Lamparter [Tue, 19 Sep 2023 19:03:24 +0000 (21:03 +0200)]
lib: constrain hash table "tabshift" both ways

The previous change to assume() did address the coverity warning about
one direction of the shift in HASH_KEY, let's constrain the other in
HASH_SIZE as well.

To be fair, the hash table *will* break at 1G entries, but at that point
we have other problems RAM-wise.  (Could bump the thing to 64-bit, but
then we need better item hash functions too on every single user.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agopimd: Use a better name for oil_parent
Donald Sharp [Thu, 14 Sep 2023 11:18:37 +0000 (07:18 -0400)]
pimd: Use a better name for oil_parent

Use oil_incoming_vif instead of oil_parent.  I had
to go look this up as that I failed to remember that
the linux kernel calls this parent for some bizarre
reason.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14299 from SaiGomathiN/14286
Russ White [Tue, 19 Sep 2023 15:36:04 +0000 (11:36 -0400)]
Merge pull request #14299 from SaiGomathiN/14286

pimd,pim6d: Resolving the YANG datatype Inconsistency for PIM Hello Interval

19 months agoMerge pull request #14414 from opensourcerouting/coverity-assume
Russ White [Tue, 19 Sep 2023 14:19:07 +0000 (10:19 -0400)]
Merge pull request #14414 from opensourcerouting/coverity-assume

lib: another attempt at Coverity false positives

19 months agoMerge pull request #14436 from opensourcerouting/fix/set_mss_for_passive_nodes
Russ White [Tue, 19 Sep 2023 14:18:14 +0000 (10:18 -0400)]
Merge pull request #14436 from opensourcerouting/fix/set_mss_for_passive_nodes

bgpd: Set TCP MSS for the socket even if the session is set to passive

19 months agoMerge pull request #14420 from opensourcerouting/fix/remove_private_asn_after_route_map
Russ White [Tue, 19 Sep 2023 14:16:33 +0000 (10:16 -0400)]
Merge pull request #14420 from opensourcerouting/fix/remove_private_asn_after_route_map

bgpd: Remove private ASNs after we modify the as-path with the route-map

19 months agoMerge pull request #14398 from m-varasteh/ospfd-rfc5709
Russ White [Tue, 19 Sep 2023 14:14:14 +0000 (10:14 -0400)]
Merge pull request #14398 from m-varasteh/ospfd-rfc5709

ospfd: add support for RFC 5709 OSPFv2 HMAC-SHA Cryptographic Authentication

19 months agoMerge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_...
Russ White [Tue, 19 Sep 2023 14:12:35 +0000 (10:12 -0400)]
Merge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_dynamic_capability_split

bgpd: Handle LLGR capability using dynamic capabilities

19 months agoMerge pull request #14350 from FRIDM636/pcep-no-commands
Russ White [Tue, 19 Sep 2023 14:08:43 +0000 (10:08 -0400)]
Merge pull request #14350 from FRIDM636/pcep-no-commands

pathd: add no command for pce/pce-config options

19 months agobgpd: snmp MIB bgp4v2 fix indexes in OID
Francois Dumontet [Thu, 14 Sep 2023 12:47:59 +0000 (14:47 +0200)]
bgpd: snmp MIB bgp4v2 fix indexes in OID

currently snmpwalk give results such :
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv6z.10.125.0.2 = INTEGER: ipv4(1)
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = INTEGER: ipv6(2)
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv6z.10.125.0.2 = Hex-STRING: 0A 7D 00 02
BGP4V2-MIB::bgp4V2PeerRemoteAddr.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Hex-STRING: FD 00 01 25 00 00 00 00 00 00 00 00 00 00 00 03

the expected result is the following

BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv4.10.125.0.2 = INTEGER: ipv4(1)
BGP4V2-MIB::bgp4V2PeerRemoteAddrType.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 =
 INTEGER: ipv6(2)
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv4.10.125.0.2 = Hex-STRING: 0A 7D 00 02
BGP4V2-MIB::bgp4V2PeerRemoteAddr.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Hex
-STRING: FD 00 01 25 00 00 00 00 00 00 00 00 00 00 00 03

in draft-ietf-idr-bgp4-mibv2-11

INDEX for Bgp4V2PeerEntry is define as follows
INDEX {
          bgp4V2PeerInstance,
          bgp4V2PeerRemoteAddrType,
          bgp4V2PeerRemoteAddr
      }

the peer instance is defined as follows
OBJECT bgp4V2PeerInstance
        SYNTAX Unsigned32 (1..4294967295)

more this interpretation is conformant with the snmpwalk implementation
for instance we obtain the following result

swBgp.bgp4V2.bgp4V2Objects.bgp4V2PeerTable.bgp4V2PeerEntry.bgp4V2PeerRemotePort.1.ipv6.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Gauge32: 179

swBgp.bgp4V2.bgp4V2Objects.bgp4V2PeerTable.bgp4V2PeerEntry.bgp4V2PeerRemoteAs.1.ipv4.10.125.0.2 = Gauge32: 65200

since currently we are not supporting  multi instance for bgp peer in
SNMP the bgp4V2PeerInstance value is set to 1 coforming to:

"Implementations that do not support multiple routing instances should return 1 for this object."

test is updated accordingly to fix.
currently index for bgp4V2NlriEntry is not coformant to MIB definition

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
19 months agobgpd: snmp MIB bg4v2 fix invalid address Type value
Francois Dumontet [Wed, 13 Sep 2023 12:26:48 +0000 (14:26 +0200)]
bgpd: snmp MIB bg4v2 fix invalid address Type value

currently an snmpwalk gives:
BGP4V2-MIB::bgp4V2PeerFsmEstablishedTime.1.ipv6z.10.125.0.2 = Gauge32: 103 seconds
BGP4V2-MIB::bgp4V2PeerFsmEstablishedTime.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Gauge32: 103 seconds

but ipv6z and dns are not the valid address type this must be ipv4 and
ipv6.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
19 months agobgpd: snmp MIB bg4v2 fix wrong type values
Francois Dumontet [Wed, 13 Sep 2023 12:29:34 +0000 (14:29 +0200)]
bgpd: snmp MIB bg4v2 fix wrong type values

snmpwalk exhibit the followinfg errors:

BGP4V2-MIB::bgp4V2PeerLastErrorReceivedTime.1.ipv6z.10.125.0.2 = Wrong Type (should be Timeticks): Gauge32: 0
BGP4V2-MIB::bgp4V2PeerLastErrorReceivedTime.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Wrong Type (should be Timeticks): Hex-STRING: 00 00 00 00 00 00 00 00
BGP4V2-MIB::bgp4V2PeerLastErrorSentTime.1.ipv6z.10.125.0.2 = Wrong Type (should be Timeticks): Gauge32: 178
BGP4V2-MIB::bgp4V2PeerLastErrorSentTime.2.dns.253.0.1.37.0.0.0.0.0.0.0.0.0.0.0.3 = Wrong Type (should be Timeticks): Hex-STRING: B2 00 00 00 00 00 00 00
Error: OID not increasing: BGP4V2-MIB::bgp4V2NlriIndex.1.4.10.200."".0.24.10.125.0.2
 >= BGP4V2-MIB::bgp4V2NlriIndex.1.4.10.200."".0.24."".0.0.0

draft-ietf-idr-bgp4-mibv2-11 states the following

bgp4V2PeerLastErrorReceivedTime OBJECT-TYPE
    SYNTAX     TimeStamp
bgp4V2PeerLastErrorSentTime OBJECT-TYPE
    SYNTAX     TimeStamp

we set the correct values

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
19 months agoMerge pull request #14422 from cscarpitta/bugfix/fix-coverity-isis-srv6
Donatas Abraitis [Tue, 19 Sep 2023 11:43:22 +0000 (14:43 +0300)]
Merge pull request #14422 from cscarpitta/bugfix/fix-coverity-isis-srv6

isisd: Fix a bunch of coverity issues in IS-IS

19 months agotests: Check if TCP MSS is synced if using a passive neighbor
Donatas Abraitis [Mon, 18 Sep 2023 19:54:53 +0000 (22:54 +0300)]
tests: Check if TCP MSS is synced if using a passive neighbor

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Set TCP min MSS per listener
Donatas Abraitis [Mon, 18 Sep 2023 19:34:45 +0000 (22:34 +0300)]
bgpd: Set TCP min MSS per listener

Set only if at least one peer is in passive mode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14429 from opensourcerouting/ospf6d-warnfix-20230916
Mark Stapp [Mon, 18 Sep 2023 19:16:02 +0000 (15:16 -0400)]
Merge pull request #14429 from opensourcerouting/ospf6d-warnfix-20230916

ospf6d: fix uninitialized warnings

19 months agobgpd: Show TCP MSS per neighbor always, despite if it's configured or not
Donatas Abraitis [Mon, 18 Sep 2023 12:54:43 +0000 (15:54 +0300)]
bgpd: Show TCP MSS per neighbor always, despite if it's configured or not

To show the TCP MSS value per neighbor you have to configure it, otherwise you
don't see the actual value.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Set TCP MSS for the socket even if the session is set to passive
Donatas Abraitis [Fri, 15 Sep 2023 11:05:41 +0000 (14:05 +0300)]
bgpd: Set TCP MSS for the socket even if the session is set to passive

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14406 from donaldsharp/pim_debug_fun
Donatas Abraitis [Mon, 18 Sep 2023 08:40:48 +0000 (11:40 +0300)]
Merge pull request #14406 from donaldsharp/pim_debug_fun

pimd: Display oil_parent as a string name of the interface

19 months agoMerge pull request #14431 from idryzhov/zebra-cleanup
Donatas Abraitis [Mon, 18 Sep 2023 08:06:05 +0000 (11:06 +0300)]
Merge pull request #14431 from idryzhov/zebra-cleanup

zebra: remove duplicated code

19 months agoMerge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet
Donatas Abraitis [Mon, 18 Sep 2023 08:05:33 +0000 (11:05 +0300)]
Merge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet

tools: make --quiet actually suppress output

19 months agoMerge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_non_defau...
Donatas Abraitis [Mon, 18 Sep 2023 07:09:12 +0000 (10:09 +0300)]
Merge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_non_default_bgp

bgpd: fix forbiding 'redistribute table' usage on non default instances

19 months agozebra: remove duplicated code
Igor Ryzhov [Sun, 17 Sep 2023 19:34:51 +0000 (22:34 +0300)]
zebra: remove duplicated code

The same thing is done in zebra_if_update_link a couple of lines above.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agoospf6d: fix uninitialized warnings
David Lamparter [Sat, 16 Sep 2023 12:17:24 +0000 (14:17 +0200)]
ospf6d: fix uninitialized warnings

GCC 13.2.0 complains:

```
ospf6d/ospf6_intra.c:139:25: error: ‘json_arr’ may be used uninitialized [-Werror=maybe-uninitialized]
ospf6d/ospf6_intra.c:485:20: error: ‘json_arr’ may be used uninitialized [-Werror=maybe-uninitialized]
```

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago[ospfd]: add support for RFC 5709 HMAC-SHA Auth
Mahdi Varasteh [Tue, 12 Sep 2023 11:39:44 +0000 (15:09 +0330)]
[ospfd]: add support for RFC 5709 HMAC-SHA Auth

This patch includes:
* Implementation of RFC 5709 support in OSPF. Using
openssl library and FRR key-chain,
one can use SHA1, SHA256, SHA384, SHA512 and
keyed-MD5( backward compatibility with RFC 2328) HMAC algs.
* Updating documentation of OSPF
* add topotests for new HMAC algorithms

Signed-off-by: Mahdi Varasteh <varasteh@amnesh.ir>
19 months agoMerge pull request #14417 from Jafaral/veth
Igor Ryzhov [Fri, 15 Sep 2023 22:03:21 +0000 (01:03 +0300)]
Merge pull request #14417 from Jafaral/veth

zebra: fix link update for veth interfaces

19 months agoisisd: Fix CID 1568134 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:36:30 +0000 (12:36 +0200)]
isisd: Fix CID 1568134 (Null pointer dereference)

Null check `isis` pointer before dereferencing it.

Fixes this coverity issue:

*** CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
/isisd/isis_zebra.c: 1146 in isis_zebra_process_srv6_locator_chunk()
1140                    "prefix %pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
1141                    chunk->locator_name, &chunk->prefix, chunk->block_bits_length,
1142                    chunk->node_bits_length, chunk->function_bits_length,
1143                    chunk->argument_bits_length);
1144
1145            /* Walk through all areas of the ISIS instance */
>>>     CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "isis", which is known to be "NULL".
1146            for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
1147                    if (strncmp(area->srv6db.config.srv6_locator_name,
1148                                chunk->locator_name,
1149                                sizeof(area->srv6db.config.srv6_locator_name)) != 0)
1150                            continue;
1151

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568133 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:30:39 +0000 (12:30 +0200)]
isisd: Fix CID 1568133 (Null pointer dereference)

Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1077 in isis_zebra_srv6_adj_sid_uninstall()
1071            enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
1072            struct interface *ifp;
1073            uint16_t prefixlen = IPV6_MAX_BITLEN;
1074            struct isis_circuit *circuit = sra->adj->circuit;
1075            struct isis_area *area = circuit->area;
1076
>>>     CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1077            if (!sra)
1078                    return;
1079
1080            switch (sra->behavior) {
1081            case SRV6_ENDPOINT_BEHAVIOR_END_X:
1082                    prefixlen = IPV6_MAX_BITLEN;

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568132 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:25:50 +0000 (12:25 +0200)]
isisd: Fix CID 1568132 (Null pointer dereference)

Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1023 in isis_zebra_srv6_adj_sid_install()
1017            struct seg6local_context ctx = {};
1018            uint16_t prefixlen = IPV6_MAX_BITLEN;
1019            struct interface *ifp;
1020            struct isis_circuit *circuit = sra->adj->circuit;
1021            struct isis_area *area = circuit->area;
1022
>>>     CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1023            if (!sra)
1024                    return;
1025
1026            sr_debug("ISIS-SRv6 (%s): setting adjacency SID %pI6", area->area_tag,
1027                     &sra->sid);
1028

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568129 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:13:45 +0000 (12:13 +0200)]
isisd: Fix CID 1568129 (Null pointer dereference)

Fix this coverity issue:

*** CID 1568129:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_tlvs.c: 2813 in unpack_item_srv6_end_sid()
2807                    sid->subsubtlvs = NULL;
2808            }
2809
2810            append_item(&subtlvs->srv6_end_sids, (struct isis_item *)sid);
2811            return 0;
2812     out:
>>>     CID 1568129:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sid" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2813            if (sid)
2814                    free_item_srv6_end_sid((struct isis_item *)sid);
2815            return 1;
2816     }
2817
2818     /* Functions related to TLVs 1 Area Addresses */

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agotests: Check if private ASNs are removed if modified by route-map
Donatas Abraitis [Thu, 14 Sep 2023 18:52:21 +0000 (21:52 +0300)]
tests: Check if private ASNs are removed if modified by route-map

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Remove private ASNs after we modify the as-path with the route-map
Donatas Abraitis [Thu, 14 Sep 2023 18:17:07 +0000 (21:17 +0300)]
bgpd: Remove private ASNs after we modify the as-path with the route-map

If we modify as-path with route-map and prepend with private ASNs, then we
advertise a new as-path without stripping private ASNs. Let's fix this, and
remove private ASNs despite if they were sent by the origin or prepended locally.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agopimd: Display oil_parent as a string name of the interface
Donald Sharp [Tue, 12 Sep 2023 22:19:23 +0000 (18:19 -0400)]
pimd: Display oil_parent as a string name of the interface

When debugging and outputting the oil_parent() let's just
convert it to a string that is useful for people trying
to debug pim

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotools: make --quiet actually suppress output
Jonas Gorski [Thu, 14 Sep 2023 15:04:16 +0000 (17:04 +0200)]
tools: make --quiet actually suppress output

When calling daemon_stop() with --quiet and e.g. the pidfile is empty,
it won't return early since while "$fail" is set, "$2" is "--quiet", so
the if condition isn't met and it will continue executing, resulting
in error messages in the log:

> Sep 14 14:48:33 localhost watchfrr[2085]: [YFT0P-5Q5YX] Forked background command [pid 2086]: /usr/lib/frr/watchfrr.sh restart all
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec

Fix this by moving the --quiet check into the block to log_failure_msg(),
and also add the check to all other invocations of log_*_msg() to make
--quiet properly suppress output.

Fixes: 19a99d89f088 ("tools: suppress unuseful warnings during restarting frr")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
19 months agozebra: fix link update for veth interfaces
Jafar Al-Gharaibeh [Thu, 14 Sep 2023 14:24:25 +0000 (09:24 -0500)]
zebra: fix link update for veth interfaces

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
19 months agopathd: reset pcc peer connection when pce options modified
Farid Mihoub [Wed, 30 Aug 2023 12:32:43 +0000 (14:32 +0200)]
pathd: reset pcc peer connection when pce options modified

Reset the PCC peer connection to take into account new changes of the
PCE options.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
19 months agopathd: add no command for pce/pce-config sub-commands
Farid MIHOUB [Thu, 24 Aug 2023 08:23:01 +0000 (10:23 +0200)]
pathd: add no command for pce/pce-config sub-commands

Add "no" command for pcep pce/pce-config sub-commands, this will mainly
restart configured options to default values.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
19 months agolib: another attempt at Coverity false positives
David Lamparter [Thu, 14 Sep 2023 09:43:56 +0000 (11:43 +0200)]
lib: another attempt at Coverity false positives

Typesafe hash tables do this:

assume((tabshift) >= 2 && (tabshift) <= 33);
(val) >> (33 - (tabshift));

Sadly, Coverity currently ignores assume() and says:
[...] right shifting by more than 31 bits has undefined behavior.
The shift amount, "33 - h->hh.tabshift", is 33.

Let's see if Coverity understands this can't happen...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoMerge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept
Donatas Abraitis [Wed, 13 Sep 2023 18:52:37 +0000 (21:52 +0300)]
Merge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept

Bgp coverity cleanup early sept

19 months agoMerge pull request #14410 from opensourcerouting/fix/keep_su_remote_local
Donald Sharp [Wed, 13 Sep 2023 16:12:13 +0000 (12:12 -0400)]
Merge pull request #14410 from opensourcerouting/fix/keep_su_remote_local

bgpd: Keep remote/local socket unions on BGP start event

19 months agobgpd: Keep remote/local socket unions on BGP start event
Donatas Abraitis [Wed, 13 Sep 2023 10:21:47 +0000 (13:21 +0300)]
bgpd: Keep remote/local socket unions on BGP start event

Not sure why this is needed, because it's reset on bgp_connect_success(),
when the session is UP.

When the session is reset, it clears those variables, and we are not able to
see what remote address was before, etc.

hostLocal, hostRemote reports Unknown for `show bgp neighbor json`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: fix forbiding 'redistribute table' usage on non default instances
Philippe Guibert [Wed, 13 Sep 2023 09:36:23 +0000 (11:36 +0200)]
bgpd: fix forbiding 'redistribute table' usage on non default instances

The 'redistribute table' command can be used by configuration on a
non default BGP instance, but this command does not work for multiple
reasons:
- The route entries configured on a given table are always configured
from the default vrf. This constraint prevents from redistributing a
prefix from the default vrf to an other non default bgp instance.
- The importation of route entries requires 'ip import-table' on vrfs
and this command is not available

Fix this by preventing from configuring this kind of redistribution
on non default bgp instances.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agoMerge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_defa...
Russ White [Wed, 13 Sep 2023 09:57:49 +0000 (05:57 -0400)]
Merge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_default_for_traditional_profile

zebra: Turn on `nht resolve-via-default` by default for traditional profile

19 months agotests: Check if LLGR settings can be changed via BGP dynamic capabilities
Donatas Abraitis [Thu, 7 Sep 2023 07:23:26 +0000 (10:23 +0300)]
tests: Check if LLGR settings can be changed via BGP dynamic capabilities

LLGR stale-time setting.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Handle LLGR capability using dynamic capabilities
Donatas Abraitis [Thu, 7 Sep 2023 07:21:45 +0000 (10:21 +0300)]
bgpd: Handle LLGR capability using dynamic capabilities

LLGR stale time is exchanged using OPEN messages. In order to
reduce stal time before doing an actual graceful restart + LLGR, it might be useful
to increase the time, but this is not possible without resetting the session.

With this change, it's possible to send dynamic capability with a new value, and
GR will respect a new reset time value when LLGR kicks in.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers file
Donatas Abraitis [Thu, 7 Sep 2023 07:17:52 +0000 (10:17 +0300)]
bgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers file

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Use explicit data types for graceful_restart_af struct
Donatas Abraitis [Thu, 7 Sep 2023 07:16:22 +0000 (10:16 +0300)]
bgpd: Use explicit data types for graceful_restart_af struct

afi/safi comes as integers, but we should decode them as uint16/uint8
accordingly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Show LLGR timers under `show bgp neighbor`
Donatas Abraitis [Thu, 7 Sep 2023 07:14:45 +0000 (10:14 +0300)]
bgpd: Show LLGR timers under `show bgp neighbor`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14400 from louis-6wind/local-no-retain
Donatas Abraitis [Wed, 13 Sep 2023 08:23:42 +0000 (11:23 +0300)]
Merge pull request #14400 from louis-6wind/local-no-retain

bgpd: fix import from a local VRF with no bgp retain

19 months agoMerge pull request #14404 from donaldsharp/snmp_mess_ups
Donatas Abraitis [Wed, 13 Sep 2023 06:52:19 +0000 (09:52 +0300)]
Merge pull request #14404 from donaldsharp/snmp_mess_ups

tests: snmp tests sometimes fail with `Unable to bind`

19 months agoMerge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR
Jafar Al-Gharaibeh [Tue, 12 Sep 2023 20:12:15 +0000 (15:12 -0500)]
Merge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR

bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr

19 months agotests: snmp tests sometimes fail with `Unable to bind`
Donald Sharp [Tue, 12 Sep 2023 17:05:05 +0000 (13:05 -0400)]
tests: snmp tests sometimes fail with `Unable to bind`

the snmp tests are using zebra.conf to setup the
address that they are binding to and immediately
after that they are starting snmpd.  If snmpd
starts up *before* zebra has installed the address
the bind on the address will fail.  Causing the entire
test to fail.  Modify the snmpd.conf for all our
snmp tests to bind to all addresses.  Things still
work and we no longer have an issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14397 from manojvn/mgmt_sb_commands
Donald Sharp [Tue, 12 Sep 2023 16:05:20 +0000 (12:05 -0400)]
Merge pull request #14397 from manojvn/mgmt_sb_commands

mgmtd: support bundle commands for mgmt.

19 months agoMerge pull request #14237 from Keelan10/pbrd-map-leak
Russ White [Tue, 12 Sep 2023 15:28:20 +0000 (11:28 -0400)]
Merge pull request #14237 from Keelan10/pbrd-map-leak

pbrd: Free Memory in pbr_map_delete

19 months agoMerge pull request #14365 from opensourcerouting/typesafe-const-declutter
Mark Stapp [Tue, 12 Sep 2023 15:20:50 +0000 (11:20 -0400)]
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter

Revert "lib: add a frr_each_const macro"

19 months agotopotests: check route import in bgp_vpnv4_noretain
Louis Scalbert [Tue, 12 Sep 2023 11:30:57 +0000 (13:30 +0200)]
topotests: check route import in bgp_vpnv4_noretain

Check route import in bgp_vpnv4_noretain

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agotopotest: fix bgp_vpnv4_noretain test descriptions
Louis Scalbert [Tue, 12 Sep 2023 11:57:50 +0000 (13:57 +0200)]
topotest: fix bgp_vpnv4_noretain test descriptions

Fix bgp_vpnv4_noretain test descriptions

Fixes: 22dfa04b78 ("topotests: more tests in bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: fix vpn import from local vrf with no retain
Louis Scalbert [Mon, 11 Sep 2023 16:33:23 +0000 (18:33 +0200)]
bgpd: fix vpn import from local vrf with no retain

The BGP "no retain" VPN option avoids storing VPN prefixes that are not
imported in the incoming BGP table (aka. Adj RIB in). When a VPN import
policy is changed, BGP does a soft clear so that a prefix refresh is
requested from the peers. However, the import from local VPN prefixes
is never requested.

Fix this issue by requesting a local import refresh.

Fixes: a486300b26 ("bgpd: implement retain route-target all behaviour")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #14379 from donaldsharp/peer_connection_part_two
Russ White [Tue, 12 Sep 2023 12:51:50 +0000 (08:51 -0400)]
Merge pull request #14379 from donaldsharp/peer_connection_part_two

Peer connection part two

19 months agoMerge pull request #14348 from opensourcerouting/fpm-rr
Russ White [Tue, 12 Sep 2023 12:45:14 +0000 (08:45 -0400)]
Merge pull request #14348 from opensourcerouting/fpm-rr

zebra: support route replace semantic in FPM