]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues
authorFrancois Dumontet <francois.dumontet@6wind.com>
Tue, 23 Apr 2024 09:16:24 +0000 (11:16 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 25 Jun 2024 05:12:09 +0000 (05:12 +0000)
commitc05a11df9e1a4f79328a7d8b9a1a350d200a0866
tree7485a9e33f918032f3ce9c89494fc3507b36837e
parent325c63c6ad147e5d8e58c5978e7a2737125685b4
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues

whith the following config

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
exit
!
bgp as-path access-list FIRST seq 5 permit ^65
bgp as-path access-list SECOND seq 5 permit 2$
!
route-map r2 permit 6
 match ip address prefix-list p2
 set as-path exclude as-path-access-list SECOND
exit
!
route-map r2 permit 10
 match ip address prefix-list p1
 set as-path exclude 65003
exit
!
route-map r2 permit 20
 match ip address prefix-list p3
 set as-path exclude all
exit

making some
no bgp as-path access-list SECOND permit 2$
bgp as-path access-list SECOND permit 3$

clear bgp *

no bgp as-path access-list SECOND permit 3$
bgp as-path access-list SECOND permit 2$

clear bgp *

will induce some crashes

thus  we rework the links between aslists and aspath_exclude

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
(cherry picked from commit 094dcc3cdac19d3da65b38effc45aa88d960909f)
bgpd/bgp_aspath.c
bgpd/bgp_aspath.h
bgpd/bgp_filter.c
bgpd/bgp_filter.h
bgpd/bgp_routemap.c