From dfb66bed1379f1d3cdff9b916ee9858f3128251c Mon Sep 17 00:00:00 2001 From: claudio Date: Wed, 25 Sep 2024 15:38:39 +0000 Subject: [PATCH] Extend maxattr test to also include IPv6 and with that test for the up_generate_mp_reach() failure. --- .../bgpd.maxattr.rdomain1.conf | 14 +++++++--- .../bgpd.maxattr.rdomain2_1.conf | 24 ++++++++++++++--- .../bgpd.maxattr.rdomain2_2.conf | 7 ++++- .../usr.sbin/bgpd/integrationtests/maxattr.sh | 26 ++++++++++++++++--- .../bgpd/integrationtests/maxattr.test1.ok | 14 ++++++++++ .../bgpd/integrationtests/maxattr.test2.ok | 12 ++++++++- 6 files changed, 86 insertions(+), 11 deletions(-) diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain1.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain1.conf index 5120c724a40..7e78a7137cc 100644 --- a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain1.conf +++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain1.conf @@ -4,23 +4,31 @@ fib-update no log updates -neighbor 10.12.57.2 { +group rdomain2_1 { descr "RDOMAIN2_1" remote-as 4200000002 + + neighbor 10.12.57.2 + neighbor 2001:db8:57::2 } -neighbor 10.12.57.3 { +group rdomain2_2 { descr "RDOMAIN2_2" remote-as 4200000003 + + neighbor 10.12.57.3 + neighbor 2001:db8:57::3 } match from any community 42:1 set prepend-self 1 -match from any community 42:2 set prepend-self 4 +match from any community 42:2 set prepend-self 10 match from any community 42:3 set { community 42:43 } match from any community 42:4 set { community 42:43 community 42:10 community 42:11 community 42:12 + large-community 42:42:42 + large-community 42:42:43 } allow from any diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_1.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_1.conf index f19ab1280b9..9a999c30df1 100644 --- a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_1.conf +++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_1.conf @@ -5,11 +5,16 @@ fib-update no log updates listen on 10.12.57.2 +listen on 2001:db8:57::2 -neighbor 10.12.57.1 { +group rdomain1 { descr "RDOMAIN1" remote-as 4200000001 local-address 10.12.57.2 + local-address 2001:db8:57::2 + + neighbor 10.12.57.1 + neighbor 2001:db8:57::1 } match to any community 0:1 set { @@ -23,6 +28,17 @@ match to any community 0:1 set { community 0:17 } +match to any community 0:2 set { + community 0:10 + community 0:11 + community 0:12 + community 0:13 + community 0:14 + community 0:15 + community 0:16 + community 0:20 + community 0:21 +} match to any community 0:10 set { large-community local-as:0:1 large-community local-as:0:2 @@ -367,8 +383,10 @@ match to any community 0:16 set { large-community local-as:6:29 large-community local-as:6:30 large-community local-as:6:31 - large-community local-as:6:32 - large-community local-as:6:33 +} +match to any community 0:17 set { + large-community local-as:7:1 + large-community local-as:7:2 } allow from any diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_2.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_2.conf index ddd64b6577c..e9f3fd28bb9 100644 --- a/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_2.conf +++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.maxattr.rdomain2_2.conf @@ -5,13 +5,18 @@ fib-update no log updates listen on 10.12.57.3 +listen on 2001:db8:57::3 socket "/var/run/bgpd.sock.12_2" -neighbor 10.12.57.1 { +group rdomain1 { descr "RDOMAIN1" remote-as 4200000001 local-address 10.12.57.3 + local-address 2001:db8:57::3 + + neighbor 10.12.57.1 + neighbor 2001:db8:57::1 } allow from any diff --git a/regress/usr.sbin/bgpd/integrationtests/maxattr.sh b/regress/usr.sbin/bgpd/integrationtests/maxattr.sh index af5282f003b..693ae347916 100644 --- a/regress/usr.sbin/bgpd/integrationtests/maxattr.sh +++ b/regress/usr.sbin/bgpd/integrationtests/maxattr.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: maxattr.sh,v 1.1 2024/09/25 14:42:39 claudio Exp $ +# $OpenBSD: maxattr.sh,v 1.2 2024/09/25 15:38:39 claudio Exp $ set -e @@ -14,7 +14,10 @@ RDOMAINS="${RDOMAIN1} ${RDOMAIN2}" PAIRS="${PAIR1} ${PAIR2}" PAIR1IP=10.12.57.1 PAIR2IP=10.12.57.2 -PAIR2IP2=10.12.57.3 +PAIR2IP_2=10.12.57.3 +PAIR1IP6=2001:db8:57::1 +PAIR2IP6=2001:db8:57::2 +PAIR2IP6_2=2001:db8:57::3 error_notify() { echo cleanup @@ -62,11 +65,16 @@ set -x echo setup ifconfig ${PAIR1} rdomain ${RDOMAIN1} ${PAIR1IP}/29 up ifconfig ${PAIR2} rdomain ${RDOMAIN2} ${PAIR2IP}/29 up -ifconfig ${PAIR2} alias ${PAIR2IP2}/32 +ifconfig ${PAIR1} inet6 ${PAIR1IP6}/64 +ifconfig ${PAIR2} inet6 ${PAIR2IP6}/64 +ifconfig ${PAIR2} alias ${PAIR2IP_2}/32 +ifconfig ${PAIR2} inet6 ${PAIR2IP6_2}/128 ifconfig ${PAIR1} patch ${PAIR2} ifconfig lo${RDOMAIN1} inet 127.0.0.1/8 ifconfig lo${RDOMAIN2} inet 127.0.0.1/8 +tcpdump -s 2000 -w /tmp/bgp.pcap -i ${PAIR1} & + echo run bgpds route -T ${RDOMAIN1} exec ${BGPD} \ -v -f ${BGPDCONFIGDIR}/bgpd.maxattr.rdomain1.conf @@ -85,6 +93,13 @@ route -T ${RDOMAIN2} exec bgpctl network add 10.12.63.0/24 community 0:1 route -T ${RDOMAIN2} exec bgpctl network add 10.12.64.0/24 community 0:1 route -T ${RDOMAIN2} exec bgpctl network add 10.12.65.0/24 community 0:1 route -T ${RDOMAIN2} exec bgpctl network add 10.12.66.0/24 community 0:1 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:60::/48 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:61::/48 community 0:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:62::/48 community 0:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:63::/48 community 0:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:64::/48 community 0:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:65::/48 community 0:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:66::/48 community 0:2 sleep 4 echo test1: check propagation @@ -97,6 +112,11 @@ route -T ${RDOMAIN2} exec bgpctl network add 10.12.63.0/24 community 0:1 communi route -T ${RDOMAIN2} exec bgpctl network add 10.12.64.0/24 community 0:1 community 42:3 route -T ${RDOMAIN2} exec bgpctl network add 10.12.65.0/24 community 0:1 community 42:4 route -T ${RDOMAIN2} exec bgpctl network add 10.12.66.0/24 community 0:1 community 42:5 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:62::/48 community 0:2 community 42:1 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:63::/48 community 0:2 community 42:2 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:64::/48 community 0:2 community 42:3 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:65::/48 community 0:2 community 42:4 +route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:66::/48 community 0:2 community 42:5 sleep 2 echo test2: check propagation diff --git a/regress/usr.sbin/bgpd/integrationtests/maxattr.test1.ok b/regress/usr.sbin/bgpd/integrationtests/maxattr.test1.ok index 5cef78fb16e..ccc86b5f596 100644 --- a/regress/usr.sbin/bgpd/integrationtests/maxattr.test1.ok +++ b/regress/usr.sbin/bgpd/integrationtests/maxattr.test1.ok @@ -12,6 +12,13 @@ flags vs destination gateway lpref med aspath origin * N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i +* N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i flags: * = Valid, > = Selected, I = via IBGP, A = Announced, S = Stale, E = Error, F = Filtered origin validation state: N = not-found, V = valid, ! = invalid @@ -26,3 +33,10 @@ flags vs destination gateway lpref med aspath origin *> N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i *> N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i *> N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i diff --git a/regress/usr.sbin/bgpd/integrationtests/maxattr.test2.ok b/regress/usr.sbin/bgpd/integrationtests/maxattr.test2.ok index 677366a4f5b..f6b8cc08ae9 100644 --- a/regress/usr.sbin/bgpd/integrationtests/maxattr.test2.ok +++ b/regress/usr.sbin/bgpd/integrationtests/maxattr.test2.ok @@ -8,10 +8,17 @@ flags vs destination gateway lpref med aspath origin * N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.62.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000002 i -* N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i +* N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i * N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i * N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i +* N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000002 i +* N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i +* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i flags: * = Valid, > = Selected, I = via IBGP, A = Announced, S = Stale, E = Error, F = Filtered origin validation state: N = not-found, V = valid, ! = invalid @@ -22,3 +29,6 @@ flags vs destination gateway lpref med aspath origin *> N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i *> N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i *> N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i +*> N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i -- 2.20.1