-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd: fix no bgp as-path access-list issue #15387
bgpd: fix no bgp as-path access-list issue #15387
Conversation
fa94447
to
8b1eb88
Compare
ci:rerun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of stuff regarding the naming to address, please.
tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py
Outdated
Show resolved
Hide resolved
tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py
Outdated
Show resolved
Hide resolved
tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py
Outdated
Show resolved
Hide resolved
@Mergifyio backport dev/10.0 stable/9.1 |
✅ Backports have been created
|
8b1eb88
to
3f3e241
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional fix is needed.
0db8dd7
to
727ccaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
727ccaa
to
b0154fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
ci:rerun |
538daea
to
4e184d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits yet.
tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py
Outdated
Show resolved
Hide resolved
4e184d5
to
b526d7d
Compare
b526d7d
to
debf109
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One grammar (renegotiate), but overall OK 🤷♂️
tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py
Outdated
Show resolved
Hide resolved
adding a tests about: "no bgp as-path access-list" command. the folloxing "clear bgp *" command leads to the crash exhibited above. a sleep had been added to capture the crash befor the end of scenario. 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. [Current thread is 1 (Thread 0x7f5f05cbb9c0 (LWP 1371086))] (gdb) bt context=0x7ffcf2c216c0) at lib/sigevent.c:248 acl_list=0x55c976ec03c0) at bgpd/bgp_aspath.c:1688 dummy=0x7ffcf2c22340, object=0x7ffcf2c21e70) at bgpd/bgp_routemap.c:2401 match_object=0x7ffcf2c21e70, set_object=0x7ffcf2c21e70, pref=0x0) at lib/routemap.c:2687 attr=0x7ffcf2c220b0, afi=AFI_IP, safi=SAFI_UNICAST, rmap_name=0x0, label=0x0, num_labels=0, dest=0x55c976ebeaf0) at bgpd/bgp_route.c:1807 addpath_id=0, attr=0x7ffcf2c22450, afi=AFI_IP, safi=SAFI_UNICAST, type=10, sub_type=0, prd=0x0, label=0x0, num_labels=0, soft_reconfig=0, evpn=0x0) at bgpd/bgp_route.c:4424 packet=0x7ffcf2c22410) at bgpd/bgp_route.c:6266 packet=0x7ffcf2c22410, mp_withdraw=false) at bgpd/bgp_packet.c:341 peer=0x55c976e89ed0, size=43) at bgpd/bgp_packet.c:2414 at bgpd/bgp_packet.c:3899 Signed-off-by: Francois Dumontet <[email protected]>
router bgp 65001 no bgp ebgp-requires-policy neighbor 192.168.1.2 remote-as external neighbor 192.168.1.2 timers 3 10 address-family ipv4 unicast neighbor 192.168.1.2 route-map r2 in exit-address-family ! ip prefix-list p1 seq 5 permit 172.16.255.31/32 ! route-map r2 permit 10 match ip address prefix-list p1 set as-path exclude 65003 route-map r2 permit 20 set as-path exclude all ! we make the following commands bgp as-path access-list FIRST permit ^65 bgp as-path access-list SECOND permit 2 route-map r2 permit 6 set as-path exclude as-path-access-list SECOND and then no bgp as-path access-list SECOND permit 2 clear bgp * we have the following crash in bgp Stack trace of thread 536083: #0 0x00007f87f8aacfe1 raise (libpthread.so.0 + 0x12fe1) FRRouting#1 0x00007f87f8cf6870 core_handler (libfrr.so.0 + 0xf6870) FRRouting#2 0x00007f87f8aad140 __restore_rt (libpthread.so.0 + 0x13140) FRRouting#3 0x00007f87f89a5122 __GI___regexec (libc.so.6 + 0xdf122) FRRouting#4 0x000055d7f198b4a7 aspath_filter_exclude_acl (bgpd + 0x2054a7) FRRouting#5 0x000055d7f1902187 route_set_aspath_exclude (bgpd + 0x17c187) FRRouting#6 0x00007f87f8ce54b0 route_map_apply_ext (libfrr.so.0 + 0xe54b0) FRRouting#7 0x000055d7f18da925 bgp_input_modifier (bgpd + 0x154925) FRRouting#8 0x000055d7f18e0647 bgp_update (bgpd + 0x15a647) FRRouting#9 0x000055d7f18e4772 bgp_nlri_parse_ip (bgpd + 0x15e772) FRRouting#10 0x000055d7f18c38ae bgp_nlri_parse (bgpd + 0x13d8ae) FRRouting#11 0x000055d7f18c6b7a bgp_update_receive (bgpd + 0x140b7a) FRRouting#12 0x000055d7f18c8ff3 bgp_process_packet (bgpd + 0x142ff3) FRRouting#13 0x00007f87f8d0dce0 thread_call (libfrr.so.0 + 0x10dce0) FRRouting#14 0x00007f87f8cacb28 frr_run (libfrr.so.0 + 0xacb28) FRRouting#15 0x000055d7f18435da main (bgpd + 0xbd5da) FRRouting#16 0x00007f87f88e9d0a __libc_start_main (libc.so.6 + 0x23d0a) FRRouting#17 0x000055d7f18415fa _start (bgpd + 0xbb5fa) analysis crash is due to the fact that there were always a pointer from as-path exclude to deleted as-path access list. fix we add a backpointer mechanism to manage the dependency beetween as-path access-list and aspath exclude. Signed-off-by: Francois Dumontet <[email protected]>
debf109
to
100ef15
Compare
failure not linked with pull request |
bgpd: fix no bgp as-path access-list issue (backport #15387)
bgpd: fix no bgp as-path access-list issue (backport #15387)
router bgp 65001
no bgp ebgp-requires-policy
neighbor 192.168.1.2 remote-as external
neighbor 192.168.1.2 timers 3 10
address-family ipv4 unicast
neighbor 192.168.1.2 route-map r2 in
exit-address-family
!
ip prefix-list p1 seq 5 permit 172.16.255.31/32
!
route-map r2 permit 10
match ip address prefix-list p1
set as-path exclude 65003
route-map r2 permit 20
set as-path exclude all
!
we make the following commands
bgp as-path access-list FIRST permit ^65
bgp as-path access-list SECOND permit 2
route-map r2 permit 6
set as-path exclude as-path-access-list SECOND
and then
no bgp as-path access-list SECOND permit 2
clear bgp *
we have the following crash in bgp
analysis
crash is due to the fact that there were always a pointer from
as-path exclude to deleted as-path access list.
fix
we add a backpointer mechanism to manage the dependency beetween
as-path access-list and aspath exclude.