]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
2 months agobuild: FRR 10.4 development version frr-10.4-dev
Jafar Al-Gharaibeh [Tue, 4 Feb 2025 16:21:51 +0000 (10:21 -0600)]
build: FRR 10.4 development version

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoMerge pull request #17969 from donaldsharp/fpm_lost_sends base_10.3
Mark Stapp [Tue, 4 Feb 2025 16:18:07 +0000 (11:18 -0500)]
Merge pull request #17969 from donaldsharp/fpm_lost_sends

zebra: Ensure dplane does not send work back to master at wrong time

2 months agoMerge pull request #17992 from chiragshah6/fdev5
Russ White [Tue, 4 Feb 2025 12:40:36 +0000 (07:40 -0500)]
Merge pull request #17992 from chiragshah6/fdev5

bgpd: fix route-distinguisher in vrf leak json cmd

2 months agoMerge pull request #17991 from chiragshah6/bgp_dev4
Donatas Abraitis [Tue, 4 Feb 2025 12:34:21 +0000 (14:34 +0200)]
Merge pull request #17991 from chiragshah6/bgp_dev4

zebra: fix evpn svd hash avoid double free

2 months agoMerge pull request #17943 from opensourcerouting/clear-event-cpu-uaf
Russ White [Tue, 4 Feb 2025 11:57:52 +0000 (06:57 -0500)]
Merge pull request #17943 from opensourcerouting/clear-event-cpu-uaf

lib: fix use after free in `clear event cpu`

2 months agoMerge pull request #17336 from forrestchu/sbfd
Russ White [Tue, 4 Feb 2025 11:36:43 +0000 (06:36 -0500)]
Merge pull request #17336 from forrestchu/sbfd

implement SBFD

2 months agoMerge pull request #17990 from enkechen-panw/aigp-cfg-default
Donatas Abraitis [Tue, 4 Feb 2025 08:51:52 +0000 (10:51 +0200)]
Merge pull request #17990 from enkechen-panw/aigp-cfg-default

bgpd: add config default for "bgp bestpath aigp"

2 months agoMerge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid
Donatas Abraitis [Tue, 4 Feb 2025 08:47:20 +0000 (10:47 +0200)]
Merge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid

staticd: Fix wrong xpath in `no sid X:X::X:X/M`

2 months agobgpd: fix route-distinguisher in vrf leak json cmd
Chirag Shah [Mon, 3 Feb 2025 20:00:41 +0000 (12:00 -0800)]
bgpd: fix route-distinguisher in vrf leak json cmd

For auto configured value RD value comes as NULL,
switching back to original change will ensure to cover
for both auto and user configured RD value in JSON.

tor-11# show bgp vrf blue ipv4 unicast route-leak json
{
  "vrf":"blue",
  "afiSafi":"ipv4Unicast",
  "importFromVrfs":[
    "purple"
  ],
  "importRts":"10.10.3.11:6",
  "exportToVrfs":[
    "purple"
  ],
  "routeDistinguisher":"(null)", <<<<<
  "exportRts":"10.10.3.11:10"
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agozebra: evpn svd hash avoid double free
Chirag Shah [Fri, 31 Jan 2025 01:26:46 +0000 (17:26 -0800)]
zebra: evpn svd hash avoid double free

Upon zebra shutdown hash_clean_and_free is called
where user free function is passed,
The free function should not call hash_release
which lead to double free of hash bucket.

Fix:
The fix is to avoid calling hash_release from
free function if its called from hash_clean_and_free
path.

10 0x00007f0422b7df1f in free () from /lib/x86_64-linux-gnu/libc.so.6
11 0x00007f0422edd779 in qfree (mt=0x7f0423047ca0 <MTYPE_HASH_BUCKET>,
    ptr=0x55fc8bc81980) at ../lib/memory.c:130
12 0x00007f0422eb97e2 in hash_clean (hash=0x55fc8b979a60,
    free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:290
13 0x00007f0422eb98a1 in hash_clean_and_free (hash=0x55fc8a675920
    <svd_nh_table>, free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:305
14 0x000055fc8a5323a5 in zebra_vxlan_terminate () at
    ../zebra/zebra_vxlan.c:6099
15 0x000055fc8a4c9227 in zebra_router_terminate () at
    ../zebra/zebra_router.c:276
16 0x000055fc8a4413b3 in zebra_finalize (dummy=0x7fffb881c1d0) at
    ../zebra/main.c:269
17 0x00007f0422f44387 in event_call (thread=0x7fffb881c1d0) at
    ../lib/event.c:2011
18 0x00007f0422ecb6fa in frr_run (master=0x55fc8b733cb0) at
    ../lib/libfrr.c:1243
19 0x000055fc8a441987 in main (argc=14, argv=0x7fffb881c4a8) at
    ../zebra/main.c:584

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agotests: Add test case to verify SID re-add
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:51 +0000 (12:56 +0100)]
tests: Add test case to verify SID re-add

Add a new test case that re-add the deleted SIDs and verifies that all
SIDs are added back to the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add test case to verify SID delete
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:41 +0000 (12:56 +0100)]
tests: Add test case to verify SID delete

Add a new test case that deletes a SID and verifies that only this
SID has been removed from the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Fix wrong xpath in `no sid X:X::X:X/M`
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:02 +0000 (12:56 +0100)]
staticd: Fix wrong xpath in `no sid X:X::X:X/M`

When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.

This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.

This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.

This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17970 from mjstapp/fix_privs_no_caps
Donald Sharp [Mon, 3 Feb 2025 17:57:44 +0000 (12:57 -0500)]
Merge pull request #17970 from mjstapp/fix_privs_no_caps

libs: return from change_caps if no caps

2 months agoMerge pull request #17913 from Sokolmish/bgp-sid-release
Carmine Scarpitta [Mon, 3 Feb 2025 13:52:00 +0000 (14:52 +0100)]
Merge pull request #17913 from Sokolmish/bgp-sid-release

bgpd: Release SID on router deletion

2 months agobgpd: add config default for "bgp bestpath aigp"
Enke Chen [Mon, 3 Feb 2025 04:35:44 +0000 (20:35 -0800)]
bgpd: add config default for "bgp bestpath aigp"

Just to make it simpler for compiling with a different default value.
No change to its default value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2 months agoMerge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify
Donatas Abraitis [Sun, 2 Feb 2025 19:17:33 +0000 (21:17 +0200)]
Merge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify

staticd: Fix NULL pointer dereference when receiving `ZAPI_SRV6_SID_RELEASED` notification

2 months agoMerge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf
Russ White [Sun, 2 Feb 2025 17:41:12 +0000 (12:41 -0500)]
Merge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf

bgpd: Do not ignore auto generated VRF instances when deleting

2 months agoMerge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager
Donatas Abraitis [Sun, 2 Feb 2025 11:32:36 +0000 (13:32 +0200)]
Merge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager

Fix SRv6 SID Manager

2 months agostaticd: Fix NULL pointer dereference
Carmine Scarpitta [Sun, 2 Feb 2025 09:06:22 +0000 (10:06 +0100)]
staticd: Fix NULL pointer dereference

When staticd receives a `ZAPI_SRV6_SID_RELEASED` notification from SRv6
SID Manager, it tries to unset the validity flag of `sid`. But since
the `sid` variable is NULL, we get a NULL pointer dereference.

```
=================================================================
==13815==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000060 (pc 0xc14b813d9eac bp 0xffffcb135a40 sp 0xffffcb135a40 T0)
==13815==The signal is caused by a READ memory access.
==13815==Hint: address points to the zero page.
    #0 0xc14b813d9eac in static_zebra_srv6_sid_notify staticd/static_zebra.c:1172
    #1 0xe44e7aa2c194 in zclient_read lib/zclient.c:4746
    #2 0xe44e7a9b69d8 in event_call lib/event.c:1984
    #3 0xe44e7a85ac28 in frr_run lib/libfrr.c:1246
    #4 0xc14b813ccf98 in main staticd/static_main.c:193
    #5 0xe44e7a4773f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #6 0xe44e7a4774c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #7 0xc14b813cc92c in _start (/usr/lib/frr/staticd+0x1c92c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV staticd/static_zebra.c:1172 in static_zebra_srv6_sid_notify
==13815==ABORTING
```

This commit fixes the problem by doing a SID lookup first. If the SID
can't be found, we log an error and return. If the SID is found, we go
ahead and unset the validity flag.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17972 from enkechen-panw/rr-policy
Donatas Abraitis [Sun, 2 Feb 2025 07:53:16 +0000 (09:53 +0200)]
Merge pull request #17972 from enkechen-panw/rr-policy

bgpd: add config default for "route-reflector allow-outbound-policy"

2 months agobgpd: add config default for "route-reflector allow-outbound-policy"
Enke Chen [Sat, 1 Feb 2025 18:24:19 +0000 (10:24 -0800)]
bgpd: add config default for "route-reflector allow-outbound-policy"

Just to make it simpler for compiling with a different default value.
No change to its default value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2 months agoMerge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business
Donatas Abraitis [Sat, 1 Feb 2025 11:25:37 +0000 (13:25 +0200)]
Merge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business

bgpd: With suppress-fib-pending ensure withdrawal is sent

2 months agobgpd: With suppress-fib-pending ensure withdrawal is sent
Donald Sharp [Fri, 31 Jan 2025 23:53:30 +0000 (18:53 -0500)]
bgpd: With suppress-fib-pending ensure withdrawal is sent

When you have suppress-fib-pending turned on it is possible
to end up in a situation where the prefix is not withdrawn
from downstream peers.

Here is the timing that I believe is happening:

a) have 2 paths to a peer.
b) receive a withdrawal from 1 path, set BGP_NODE_FIB_INSTALL_PENDING
   and send the route install to zebra.
c) receive a withdrawal from the other path.
d) At this point we have a dest->flags set BGP_NODE_FIB_INSTALL_PENDING
   old_select the path_info going away, new_select is NULL
e) A bit further down we call group_announce_route() which calls
   the code to see if we should advertise the path.  It sees the
   BGP_NODE_FIB_INSTALL_PENDING flag and says, nope.
f) the route is sent to zebra to withdraw, which unsets the
   BGP_NODE_FIB_INSTALL_PENDING.
g) This function winds up and deletes the path_info.  Dest now
   has no path infos.
h) BGP receives the route install(from step b) and unsets the
   BGP_NODE_FIB_INSTALL_PENDING flag
i) BGP receives the route removed from zebra (from step f) and
   unsets the flag again.

We know if there is no new_select, let's go ahead and just
unset the PENDING flag to allow the withdrawal to go out
at the time when the second withdrawal is received.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agolibs: return from change_caps if no caps
Mark Stapp [Fri, 31 Jan 2025 18:13:48 +0000 (13:13 -0500)]
libs: return from change_caps if no caps

When called without caps/privs, just return from "change_caps"
instead of exiting - it's possible that a process may not need
privs, but a lib (for example) may use the api.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 months agozebra: Ensure dplane does not send work back to master at wrong time
Donald Sharp [Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)]
zebra: Ensure dplane does not send work back to master at wrong time

When looping through the dplane providers, the worklist was
being populated with items from the last provider and then
the event system was checked to see if we should stop processing.
If the event system says `yes` then the dplane code would stop
and send the worklist to the master zebra pthread for collection.
This obviously skipped the next dplane provider on the list
which is double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous
Donatas Abraitis [Fri, 31 Jan 2025 11:56:09 +0000 (13:56 +0200)]
Merge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous

isisd: fix erroneous srv6 information in database

2 months agotests: Add testcase for static End/uN validation
Carmine Scarpitta [Thu, 30 Jan 2025 18:26:57 +0000 (19:26 +0100)]
tests: Add testcase for static End/uN validation

This commit adds a testcase to validate static End/uN allocation.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agozebra: Fix SRv6 SID Manager
Carmine Scarpitta [Thu, 30 Jan 2025 18:25:57 +0000 (19:25 +0100)]
zebra: Fix SRv6 SID Manager

The SRv6 SID Manager does not allow allocating an SRv6 End/uN function
even though it is already supported by staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17934 from nabahr/autorp-close
Donatas Abraitis [Thu, 30 Jan 2025 14:19:40 +0000 (16:19 +0200)]
Merge pull request #17934 from nabahr/autorp-close

pimd: Close AutoRP socket when not needed

2 months agotopotests: Router deletion in SRv6 sid reachability
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:47 +0000 (01:54 +0300)]
topotests: Router deletion in SRv6 sid reachability

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agobgpd: Release SID on router deletion
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:31 +0000 (01:54 +0300)]
bgpd: Release SID on router deletion

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agoMerge pull request #17935 from mjstapp/fix_nhg_hash_equal
Donald Sharp [Wed, 29 Jan 2025 15:14:37 +0000 (10:14 -0500)]
Merge pull request #17935 from mjstapp/fix_nhg_hash_equal

zebra: include resolving nexthops in nhg hash

2 months agoMerge pull request #17946 from bobuhiro11/normalize_ebgp_multihop
Donatas Abraitis [Wed, 29 Jan 2025 12:05:12 +0000 (14:05 +0200)]
Merge pull request #17946 from bobuhiro11/normalize_ebgp_multihop

tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

2 months agoisisd: fix erroneous srv6 information in database
Philippe Guibert [Wed, 29 Jan 2025 11:19:24 +0000 (12:19 +0100)]
isisd: fix erroneous srv6 information in database

The show isis database detail command dumps invalid srv6 information:
>  SRv6 Locator: fc00:0:6::/64 (Metric: 0) ipv6-unicast
>    Sub-TLVs:
>      SRv6 End SID Endpoint Behavior: unknown, SID value: fc00:0:6:0:1::
>
>  MT Reachability: 0123.6452.1973.03 (Metric: 10) ipv6-unicast
>    Local Interface IPv6 Address(es): 192::4:3
>    SRv6 Lan End.X SID: fc00:0:3:0:43::, Algorithm: SPF, Weight: 0, Endpoint Behavior: End.DX6, Flags: B:0, S:0, P:0 Neighbor-ID: 0123.6452.1975
>        SRv6 SID Structure Locator Block length: 40, Locator Node length: 24, Function length: 16, Argument length: 0,

The behavior codepoint should use the IANA definitions to display the
correct value. Fix this by calling the appropriate convert function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agotools: Fix frr-reload for ebgp-multihop TTL reconfiguration.
Nobuhiro MIKI [Wed, 29 Jan 2025 04:31:53 +0000 (04:31 +0000)]
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

In ebgp-multihop, there is a difference in reload behavior when TTL is
unspecified (meaning default 255) and when 255 is explicitly specified.
For example, when reloading with 'neighbor <neighbor> ebgp-multihop
255' in the config, the following difference is created. This commit
fixes that.

    Lines To Delete
    ===============
    router bgp 65001
     no neighbor 10.0.0.4 ebgp-multihop
    exit

    Lines To Add
    ============
    router bgp 65001
     neighbor 10.0.0.4 ebgp-multihop 255
    exit

The commit 767aaa3a8048 is not sufficient and frr-reload needs to be
fixed to handle both unspecified and specified cases.

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2 months agotests: Add a test that shows the v6 recursive nexthop problem
Donald Sharp [Mon, 27 Jan 2025 15:34:31 +0000 (10:34 -0500)]
tests: Add a test that shows the v6 recursive nexthop problem

Currently FRR does not handle v6 recurisive resolution properly
when the route being recursed through changes and the most
significant bits of the route are not changed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17941 from opensourcerouting/fix-dst-src
Russ White [Tue, 28 Jan 2025 17:23:06 +0000 (12:23 -0500)]
Merge pull request #17941 from opensourcerouting/fix-dst-src

static: fix botched staticd YANG conversion for dst-src

2 months agoMerge pull request #17802 from askorichenko/test-fix-table-map
Russ White [Tue, 28 Jan 2025 17:20:43 +0000 (12:20 -0500)]
Merge pull request #17802 from askorichenko/test-fix-table-map

bgpd: fix table-map option

2 months agoMerge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops
Russ White [Tue, 28 Jan 2025 17:19:07 +0000 (12:19 -0500)]
Merge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops

ospfd: Prune duplicate next-hop when installing into zebra route table.

2 months agoMerge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping
Russ White [Tue, 28 Jan 2025 16:49:20 +0000 (11:49 -0500)]
Merge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping

Isis srv6 topo1 ping

2 months agoMerge pull request #17924 from donaldsharp/evaluate_paths_optimization
Russ White [Tue, 28 Jan 2025 16:29:15 +0000 (11:29 -0500)]
Merge pull request #17924 from donaldsharp/evaluate_paths_optimization

bgpd: Optimize evaluate paths for a peer going down

2 months agoMerge pull request #17881 from opensourcerouting/fix/last_reset_reason
Russ White [Tue, 28 Jan 2025 15:40:50 +0000 (10:40 -0500)]
Merge pull request #17881 from opensourcerouting/fix/last_reset_reason

bgpd: last reset SNAFU

2 months agolib: fix use after free in `clear event cpu`
David Lamparter [Tue, 28 Jan 2025 15:37:52 +0000 (16:37 +0100)]
lib: fix use after free in `clear event cpu`

Freeing any item here means freeing someone's `event->hist`, leaving a
dangling pointer there.  Which will immediately be written to because
we're executing in a CLI function under the `vty_read` event, whose
`event->hist` is then updated.

Deallocating `event->hist` anywhere other than shutting down the whole
event loop is a bad idea to begin with, just zero out the stats instead.

Fixes: FRRouting/frr#16419
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agoMerge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727
Russ White [Tue, 28 Jan 2025 15:35:57 +0000 (10:35 -0500)]
Merge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727

bgpd: Check if the peer really exists before sending dynamic capability

2 months agoMerge pull request #17736 from opensourcerouting/table-direct
Russ White [Tue, 28 Jan 2025 15:24:00 +0000 (10:24 -0500)]
Merge pull request #17736 from opensourcerouting/table-direct

bgpd,lib,zebra: permit table-direct on VRFs

2 months agobgpd: Do not ignore auto generated VRF instances when deleting
Donatas Abraitis [Tue, 28 Jan 2025 15:11:58 +0000 (17:11 +0200)]
bgpd: Do not ignore auto generated VRF instances when deleting

When VRF instance is going to be deleted inside bgp_vrf_disable(), it uses
a helper method that skips auto created VRF instances and that leads to STALE
issue.

When creating a VNI for a particular VRF vrfX with e.g. `advertise-all-vni`,
auto VRF instance is created, and then we do `router bgp ASN vrf vrfX`.

But when we do a reload bgp_vrf_disable() is called, and we miss previously
created auto instance.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agotopotests: test v6 & dst-src in static_simple
David Lamparter [Mon, 27 Jan 2025 17:36:12 +0000 (18:36 +0100)]
topotests: test v6 & dst-src in static_simple

The "static_simple" test has code for testing IPv6 routes, but it wasn't
even being run (duh.)  Enable it, and also test IPv6 dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agostaticd: fix NHT for dst-src routes
David Lamparter [Mon, 27 Jan 2025 16:57:54 +0000 (17:57 +0100)]
staticd: fix NHT for dst-src routes

staticd's NHT code wasn't updating dst-src routes :(

Fixes: FRRouting/frr#14247
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agolib, zebra: carry source prefix in route_notify
David Lamparter [Mon, 27 Jan 2025 19:26:32 +0000 (20:26 +0100)]
lib, zebra: carry source prefix in route_notify

When a daemon wants to know about its routes, make it possible to have
that work for dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agostaticd: fix botched staticd YANG for dst-src
David Lamparter [Mon, 27 Jan 2025 17:18:24 +0000 (18:18 +0100)]
staticd: fix botched staticd YANG for dst-src

The staticd YANG conversion completely f*cked up dst-src routes.
Stupidly enough, the correct thing is much simpler as seen by the amount
of deletes in this commit.

This does, unfortunately, involve a rather annoying YANG edge case with
what should reasonably be an optional leaf as part of a list key, which
is not possible.  It uses `::/0` as unconditional filler instead, since
that is semantically correct.

The `test_yang_mgmt` topotest needed to be adjusted after this to add
`src-prefix='::/0'`.

Fixes: 88fa5104a04a ("staticd : Configuration northbound implementation")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agobgpd: fix table-map option
Alexander Skorichenko [Thu, 23 Jan 2025 10:35:44 +0000 (11:35 +0100)]
bgpd: fix table-map option

Schedule zebra to withdraw routes filtered out by a table-map.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
3 months agozebra: install dst-src routes without NHG
David Lamparter [Mon, 27 Jan 2025 16:57:15 +0000 (17:57 +0100)]
zebra: install dst-src routes without NHG

The Linux kernel doesn't support dst-src routes with NHGs as nexthop,
for some (rather dubious) caching reasons.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agoMerge pull request #17905 from pguibert6WIND/advertised_routes_incorrect_json
Donatas Abraitis [Mon, 27 Jan 2025 21:32:33 +0000 (23:32 +0200)]
Merge pull request #17905 from pguibert6WIND/advertised_routes_incorrect_json

Advertised routes incorrect json

3 months agoMerge pull request #17919 from pguibert6WIND/bgp_suppressed_attribute
Donatas Abraitis [Mon, 27 Jan 2025 21:31:46 +0000 (23:31 +0200)]
Merge pull request #17919 from pguibert6WIND/bgp_suppressed_attribute

Bgp suppressed attribute

3 months agozebra: include resolving nexthops in nhg hash
Mark Stapp [Mon, 27 Jan 2025 19:17:24 +0000 (14:17 -0500)]
zebra: include resolving nexthops in nhg hash

Ensure that the nhg hash comparison function includes all
nexthops, including recursive-resolving nexthops.

Signed-off-by: Mark Stapp <mjs@cisco.com>
3 months agopimd: Close AutoRP socket when not needed
Nathan Bahr [Mon, 27 Jan 2025 15:57:04 +0000 (15:57 +0000)]
pimd: Close AutoRP socket when not needed

Don't leave the socket open if we are not enabled for discovery
or announcements.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agoMerge pull request #17926 from opensourcerouting/fix/remove_addpath_dynamic_handling
Donald Sharp [Mon, 27 Jan 2025 12:14:00 +0000 (07:14 -0500)]
Merge pull request #17926 from opensourcerouting/fix/remove_addpath_dynamic_handling

Revert "bgpd: Handle Addpath capability using dynamic capabilities"

3 months agobgpd: fix missing braces when dumping json vpn advertised-routes
Philippe Guibert [Wed, 22 Jan 2025 14:35:06 +0000 (15:35 +0100)]
bgpd: fix missing braces when dumping json vpn advertised-routes

The json output of advertised-routes is incorrect, as there is a missing
brace with route-distinguisher:

observed with the bgp_vpnv4_noretain test:
> "bgpTableVersion":0,"bgpLocalRouterId":"192.0.2.1","defaultLocPrf":100,"localAS":65500,
> "advertisedRoutes": "192.0.2.1:1":{"rd":"192.0.2.1:1","10.101.0.0/24":{"prefix":"10.101.0.0/24",

expected:
> "bgpTableVersion":0,"bgpLocalRouterId":"192.0.2.1","defaultLocPrf":100,"localAS":65500,
> "advertisedRoutes": { "192.0.2.1:1":{"rd":"192.0.2.1:1","10.101.0.0/24":{"prefix":"10.101.0.0/24",
>                     ^
>                     missing brace

Fix this by adding the missing braces.

Fixes: 4838bac033a7 ("bgpd: neighbors received-routes/advertised-routes stringify changes")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agotopotests: bgp_vpnv4_noretain, check presence of locpref in adj-rib-out
Philippe Guibert [Mon, 6 Jan 2025 16:03:26 +0000 (17:03 +0100)]
topotests: bgp_vpnv4_noretain, check presence of locpref in adj-rib-out

Add a test that check that the detailed command of show bgp advertised
neighbors 10.125.0.2 displays the locpref value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agotopotests: bgp_aggregate_address_topo1, add test for suppressed keyword
Philippe Guibert [Fri, 24 Jan 2025 12:38:21 +0000 (13:38 +0100)]
topotests: bgp_aggregate_address_topo1, add test for suppressed keyword

Add a test that checks that the BGP route to 192.168.0.1 has all the
necessary json outputs. This route is chosen because it is a suppressed
route.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agobgpd: fix add json attribute to reflect suppressed path
Philippe Guibert [Fri, 24 Jan 2025 12:22:03 +0000 (13:22 +0100)]
bgpd: fix add json attribute to reflect suppressed path

When aggregate is used, the suppressed information is not displayed in
the json attributes of a given path. To illustrate, the dump of the
192.168.2.1/32 path in the bgp_aggregate_address_topo1 topotest:

> # show bgp ipv4
> [..]
>  s> 192.168.2.1/32   10.0.0.2                               0 65001 i
>
> # show bgp ipv4 detail
> [..]
> BGP routing table entry for 192.168.2.1/32, version 17
> Paths: (1 available, best #1, table default, vrf (null), Advertisements suppressed by an aggregate.)
>   Not advertised to any peer
>   65001            <---- missing suppressed flag
>     10.0.0.2 from 10.0.0.2 (10.254.254.3)
>       Origin IGP, valid, external, best (First path received)
>       Last update: Fri Jan 24 13:11:41 2025
>
> # show bgp ipv4 detail json
> [..]
> ,"192.168.2.1/32": [{"aspath":{"string":"65001","segments":[{"type":"as-sequence","list":[65001]}],"length":1},"origin":"IGP","valid":true,"version":17,
> "bestpath":{"overall":true,"selectionReason":"First path received"},                <---- missing suppressed flag
> "lastUpdate":{"epoch":1737720700,"string":"Fri Jan 24 13:11:40 2025\n"},
> "nexthops":[{"ip":"10.0.0.2","afi":"ipv4","metric":0,"accessible":true,"used":true}],
> "peer":{"peerId":"10.0.0.2","routerId":"10.254.254.3","type":"external"}}]

Fix this by adding the json information.

> # show bgp ipv4 detail
> [..]
> BGP routing table entry for 192.168.2.1/32, version 17
> Paths: (1 available, best #1, table default, vrf (null), Advertisements suppressed by an aggregate.)
>   Not advertised to any peer
>   65001, (suppressed)
>     10.0.0.2 from 10.0.0.2 (10.254.254.3)
>       Origin IGP, valid, external, best (First path received)
>       Last update: Fri Jan 24 13:11:41 2025
>
> # show bgp ipv4 detail json
> [..]
> ,"192.168.2.1/32": [{"aspath":{"string":"65001","segments":[{"type":"as-sequence","list":[65001]}],"length":1},"suppressed":true,"origin":"IGP","valid":true,"version":17,
> "bestpath":{"overall":true,"selectionReason":"First path received"},
> "lastUpdate":{"epoch":1737720991,"string":"Fri Jan 24 13:16:31 2025"},
> "nexthops":[{"ip":"10.0.0.2","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"10.0.0.2","routerId":"10.254.254.3","type":"external"}}]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agoMerge pull request #17917 from pguibert6WIND/isis_duplicate_asla
Donatas Abraitis [Mon, 27 Jan 2025 09:51:14 +0000 (11:51 +0200)]
Merge pull request #17917 from pguibert6WIND/isis_duplicate_asla

isisd: fix duplicate rfc8919 defines

3 months agoRevert "bgpd: Handle Addpath capability using dynamic capabilities"
Donatas Abraitis [Sat, 25 Jan 2025 18:28:26 +0000 (20:28 +0200)]
Revert "bgpd: Handle Addpath capability using dynamic capabilities"

This reverts commit 05cf9d03b345393b8d63ffe9345c42debd8362b6.

TL;DR; Handling BGP AddPath capability is not trivial (possible) dynamically.

When the sender is AddPath-capable and sends NLRIs encoded with AddPath ID,
and at the same time the receiver sends AddPath capability "disable-addpath-rx"
(flag update) via dynamic capabilities, both peers are out of sync about the
AddPath state. The receiver thinks already he's not AddPath-capable anymore,
hence it tries to parse NLRIs as non-AddPath, while they are actually encoded
as AddPath.

AddPath capability itself does not provide (in RFC) any mechanism on backward
compatible way to handle NLRIs if they come mixed (AddPath + non-AddPath).

This explains why we have failures in our CI periodically.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agobgpd: Optimize evaluate paths for a peer going down
Donald Sharp [Fri, 24 Jan 2025 20:04:13 +0000 (15:04 -0500)]
bgpd: Optimize evaluate paths for a peer going down

Currently when a directly connected peer is going down
BGP gets a call back for nexthop tracking in addition
the interface down events.  On the interface down
event BGP goes through and sets up a per peer Q that
holds all the bgp path info's associated with that peer
and then it goes and processes this in the future.  In
the meantime zebra is also at work and sends a nexthop
removal event to BGP as well.  This triggers a complete
walk of all path info's associated with the bnc( which
happens to be all the path info's already scheduled
for removal here shortly).  This evaluate paths
is not an inexpensive operation in addition the work
for handling this is already being done via the
peer down queue.  Let's optimize the bnc handling
of evaluate paths and check to see if the peer is
still up to actually do the work here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agoMerge pull request #17912 from opensourcerouting/libyang_require
Jafar Al-Gharaibeh [Fri, 24 Jan 2025 19:05:18 +0000 (13:05 -0600)]
Merge pull request #17912 from opensourcerouting/libyang_require

redhat: Specify minimum libyang version requirement

3 months agoisisd: fix duplicate rfc8919 defines
Philippe Guibert [Fri, 24 Jan 2025 09:32:37 +0000 (10:32 +0100)]
isisd: fix duplicate rfc8919 defines

The application specific defines from rfc8919 were defined twice in the
isis tlv headers. Remove the second one.

Fixes: 5749ac83a8ad ("isisd: add ASLA support")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agoMerge pull request #17911 from askorichenko/test-fix-bgp-peer-solo
Donatas Abraitis [Fri, 24 Jan 2025 06:50:49 +0000 (08:50 +0200)]
Merge pull request #17911 from askorichenko/test-fix-bgp-peer-solo

bgpd: Fix bgp peer solo option

3 months agobgpd,lib: document the table id / instance usage
Rafael Zalamena [Thu, 23 Jan 2025 18:13:01 +0000 (15:13 -0300)]
bgpd,lib: document the table id / instance usage

Document where relevant about the instance overload to table ID so users
know what to expect.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agotopotests: test direct-table on different VRFs
Rafael Zalamena [Mon, 30 Dec 2024 19:55:49 +0000 (16:55 -0300)]
topotests: test direct-table on different VRFs

Test new zebra feature that allows table-direct to work on any VRF
with BGP.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agobgpd: allow table-direct on different VRFs
Rafael Zalamena [Mon, 30 Dec 2024 19:55:12 +0000 (16:55 -0300)]
bgpd: allow table-direct on different VRFs

Allow table-direct to be configured in different VRFs.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agolib,zebra: VRF table-direct support
Rafael Zalamena [Thu, 11 Jan 2024 20:23:28 +0000 (17:23 -0300)]
lib,zebra: VRF table-direct support

Implement the necessary data structures and code changes to support sending
table-direct routes to protocols running in different VRFs.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agolib: abstract instance redistribution management
Rafael Zalamena [Thu, 11 Jan 2024 20:12:44 +0000 (17:12 -0300)]
lib: abstract instance redistribution management

Use the linked list `del` callback to free memory instead of manually calling.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 months agoospfd: Prune duplicate next-hops when installing into zebra
Acee Lindem [Wed, 22 Jan 2025 20:41:47 +0000 (20:41 +0000)]
ospfd: Prune duplicate next-hops when installing into zebra

Duplicate next-hops are maintained for OSPF inter-area and AS
external routes in the OSPF routing table as long as they
correspond to LSAs for different adverting routers. The
intra-area route computation will not result in duplicate
next-hops.

Signed-off-by: Acee Lindem <acee@lindem.com>
3 months agotests: OSPF topotest for next-hop pruning
Acee Lindem [Wed, 22 Jan 2025 20:32:50 +0000 (20:32 +0000)]
tests: OSPF topotest for next-hop pruning

OSPF topotest to test OSPF next-hop pruning on installation
into zebra routing table. Also fix multicast_pim_dr_nondr_test
topotest which had a duplicate OSPF route in the results.

Signed-off-by: Acee Lindem <acee@lindem.com>
X

3 months agoredhat: Specify minimum libyang version requirement
Martin Winter [Thu, 23 Jan 2025 13:13:51 +0000 (14:13 +0100)]
redhat: Specify minimum libyang version requirement

Version requirement from a BuildRequire get dropped and don't get
reflected in Require's for the package. Specify it both ways for
Libyang as we require >= 2.1.128

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 months agobgpd: Fix bgp peer solo option
Alexander Skorichenko [Thu, 23 Jan 2025 11:14:41 +0000 (12:14 +0100)]
bgpd: Fix bgp peer solo option

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
3 months agoMerge pull request #17898 from Pdoijode/pdoijode/fix-ip-route-cmd
Donatas Abraitis [Thu, 23 Jan 2025 13:46:59 +0000 (15:46 +0200)]
Merge pull request #17898 from Pdoijode/pdoijode/fix-ip-route-cmd

zebra: Return error if v6 prefix is passed to show ip route

3 months agoMerge pull request #17652 from pguibert6WIND/topotest_bgp_evpn_rt5
Donatas Abraitis [Thu, 23 Jan 2025 11:12:35 +0000 (13:12 +0200)]
Merge pull request #17652 from pguibert6WIND/topotest_bgp_evpn_rt5

bgpd, tests: bgp_evpn_rt5, add test with match evpn vni command

3 months agoMerge pull request #17904 from louis-6wind/fix-bfd-pg-update-group
Donatas Abraitis [Thu, 23 Jan 2025 08:09:55 +0000 (10:09 +0200)]
Merge pull request #17904 from louis-6wind/fix-bfd-pg-update-group

bgpd: fix bfd with update-source in peer-group

3 months agodoc: add sbfd doc
wumu.zsl [Tue, 21 Jan 2025 08:25:30 +0000 (08:25 +0000)]
doc: add sbfd doc

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agotests: add basic topotest cases for sbfd Initiator and Reflector
wumu.zsl [Tue, 21 Jan 2025 08:25:03 +0000 (08:25 +0000)]
tests: add basic topotest cases for sbfd Initiator and Reflector

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: Fix CI build issue on kernel with no IPV6_HDRINCL
wumu.zsl [Thu, 23 Jan 2025 03:24:43 +0000 (03:24 +0000)]
bfdd: Fix CI build issue on kernel with no IPV6_HDRINCL

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: add bfdname info when notify bfd status to PTM
wumu.zsl [Tue, 21 Jan 2025 07:59:50 +0000 (07:59 +0000)]
bfdd: add bfdname info when notify bfd status to PTM

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: enable sbfd session
wumu.zsl [Tue, 21 Jan 2025 06:56:32 +0000 (06:56 +0000)]
bfdd: enable sbfd session

1) create socket to send sbfd packets
2) integrate sbfd logic with existing BFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: add sbfd state machine functions
wumu.zsl [Tue, 21 Jan 2025 06:32:47 +0000 (06:32 +0000)]
bfdd: add sbfd state machine functions

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: implement functions for sending sbfd pkts with SRv6 header
wumu.zsl [Tue, 21 Jan 2025 06:07:15 +0000 (06:07 +0000)]
bfdd: implement functions for sending sbfd pkts with SRv6 header

Two types of sbfd packets are supported: initiator packet and echo packet

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: create a hash table for local sbfd reflector info
wumu.zsl [Tue, 21 Jan 2025 05:41:35 +0000 (05:41 +0000)]
bfdd: create a hash table for local sbfd reflector info

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: adjust show commands for SBFD
wumu.zsl [Tue, 21 Jan 2025 03:36:55 +0000 (03:36 +0000)]
bfdd: adjust show commands for SBFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: add sbfd config commands to bfdd cli
wumu.zsl [Tue, 21 Jan 2025 03:36:00 +0000 (03:36 +0000)]
bfdd: add sbfd config commands to bfdd cli

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: implement Xpath callbacks for SBFD
wumu.zsl [Tue, 21 Jan 2025 03:15:09 +0000 (03:15 +0000)]
bfdd: implement Xpath callbacks for SBFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: support sbfd session create and destroy
wumu.zsl [Tue, 21 Jan 2025 03:11:03 +0000 (03:11 +0000)]
bfdd: support sbfd session create and destroy

refactor bfd_session_create and bfd_session_destroy to support SBFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: add vtysh commands for sbfd
wumu.zsl [Tue, 21 Jan 2025 02:44:13 +0000 (02:44 +0000)]
bfdd: add vtysh commands for sbfd

config examples:
    SBFD Initiator: peer 200::D bfd-mode sbfd-init bfd-name a-b-d multihop local-address 200::A remote-discr 456 srv6-source-ipv6 200::A srv6-encap-data 100::B 100::D
    SBFD Reflector: sbfd reflector source-address 200::D discriminator 456
    Echo SBFD: peer 200::A bfd-mode sbfd-echo bfd-name a-b-d local-address 200::A srv6-source-ipv6 200::A srv6-encap-data 100::B 100::D

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agobfdd: modify frr-bfdd.yang for sbfd echo and sbfd init
wumu.zsl [Tue, 21 Jan 2025 02:43:52 +0000 (02:43 +0000)]
bfdd: modify frr-bfdd.yang for sbfd echo and sbfd init

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
3 months agozebra: Return error if v6 prefix is passed to show ip route
Pooja Jagadeesh Doijode [Tue, 21 Jan 2025 22:19:32 +0000 (14:19 -0800)]
zebra: Return error if v6 prefix is passed to show ip route

Return error if IPv6 address or prefix is passed as an argument
to "show ip route" command.

UT:
r1# show ip route 2::3/128
% Cannot specify IPv6 address/prefix for IPv4 table
r1#
r1# show ip route 2::3
% Cannot specify IPv6 address/prefix for IPv4 table
r1#

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
3 months agotopotests: isis_srv6_topo1, fix wrong srte path
Philippe Guibert [Wed, 22 Jan 2025 16:18:03 +0000 (17:18 +0100)]
topotests: isis_srv6_topo1, fix wrong srte path

There is no connectivity by using the proposed srv6 path.

> From Carmine:
> This seg6-route tells rt1 to steer packets destined to fc00:0:9::1 over this path: rt1->rt2->-rt6.
> This path is not correct. Since we are installing this seg6-route on rt1,
> it means that a packet matching this seg6-route has already reached rt1.
> So rt1 should not be part of the path.
> The correct path should be rt2->rt6.

Fix this by changing the proposed seg6 route. Also, the ping test should
be swapped, because invalidating the RT1 locator does not have any
impacts on the built SRv6 path.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agobgpd: fix bfd with update-source in peer-group
Louis Scalbert [Wed, 22 Jan 2025 12:30:55 +0000 (13:30 +0100)]
bgpd: fix bfd with update-source in peer-group

Fix BFD session not created when the peer is in update-group with the
update-source option.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 months agotests: check bfd with update-source in peer-group
Louis Scalbert [Wed, 22 Jan 2025 12:30:04 +0000 (13:30 +0100)]
tests: check bfd with update-source in peer-group

Check bfd with update-source in peer-group.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 months agoisis_srv6_topo1: fix ping does not work as expected
Philippe Guibert [Mon, 13 Jan 2025 14:41:32 +0000 (15:41 +0100)]
isis_srv6_topo1: fix ping does not work as expected

The ping test does not detect when the command fails.

> 2025-01-13 15:38:27,494 INFO: topo: [+] check rt1 fc00:0:9::1 0% packet loss
> 2025-01-13 15:38:27,494 WARNING: topo: Waiting time is too small (count=10, wait=1), using default values (count=20, wait=3)
> 2025-01-13 15:38:28,501 WARNING: rt1: Router(rt1): proc failed: rc 1 pid 2028454
>  args: /usr/bin/nsenter --mount=/proc/2026950/ns/mnt --net=/proc/2026950/ns/net --uts=/proc/2026950/ns/uts -F --wd=/tmp/topotests/isis_srv6_topo1.test_isis_srv6_topo1/rt1 /bin/bash -c ping6 fc00:0:9::1 -c 1 -w 1
>  stdout: PING fc00:0:9::1(fc00:0:9::1) 56 data bytes
>
> --- fc00:0:9::1 ping statistics ---
> 1 packets transmitted, 0 received, 100% packet loss, time 0ms
>  stderr: *empty*
> 2025-01-13 15:38:28,501 INFO: topo: PING fc00:0:9::1(fc00:0:9::1) 56 data bytes
>
> --- fc00:0:9::1 ping statistics ---
> 1 packets transmitted, 0 received, 100% packet loss, time 0ms
>
>
> PASSED
>

The match string is not precise enough. Complete it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 months agobfdd: add bfdname in bfd_key
wumu.zsl [Mon, 20 Jan 2025 13:48:38 +0000 (13:48 +0000)]
bfdd: add bfdname in bfd_key

sbfd will use bfdname for key hash, We introduced a bfd-name for every sbfd session, normal BFD sessions can leave it as NULL.
A unique bfd-name can be used to identify a sbfd session quickly. This is quite useful in our Srv6 deployment for path protection case.
For example, if use the sbfd session to protect the SRv6 path A-B-D, we would assign the name 'path-a-b-d' or 'a-b-d' to the session.

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>