diff options
-rw-r--r-- | bgpd/bgp_bfd.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_bmp.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_evpn_mh.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 13 | ||||
-rw-r--r-- | bgpd/bgp_route.h | 1 | ||||
-rw-r--r-- | bgpd/bgp_zebra.c | 7 | ||||
-rw-r--r-- | doc/developer/packaging-redhat.rst | 15 | ||||
-rw-r--r-- | lib/northbound_notif.c | 1 | ||||
-rw-r--r-- | redhat/frr.spec.in | 54 | ||||
-rw-r--r-- | tests/topotests/bgp_bfd_session/r1/frr.conf | 12 | ||||
-rw-r--r-- | tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py | 24 | ||||
-rw-r--r-- | tests/topotests/bgp_rpki_topo1/r2/bgp_rpki_valid.json | 3 | ||||
-rwxr-xr-x | tools/frr-reload.py | 13 |
13 files changed, 105 insertions, 46 deletions
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 78759ae2b..5437b67f3 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -114,6 +114,10 @@ void bgp_peer_config_apply(struct peer *p, struct peer_group *pg) */ gconfig = pg->conf; + if (CHECK_FLAG(gconfig->flags, PEER_FLAG_UPDATE_SOURCE) || + CHECK_FLAG(p->flags_override, PEER_FLAG_UPDATE_SOURCE)) + bgp_peer_bfd_update_source(p); + /* * If using default control plane independent configuration, * then prefer group's (e.g. it means it wasn't manually configured). diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 21f921255..e458e5e5a 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -2451,7 +2451,7 @@ static void bmp_send_all_bgp(struct peer *peer, bool down) if (!bmpbgp) continue; frr_each (bmp_targets, &bmpbgp->targets, bt) { - if (bgp_vrf != peer->bgp && !bmp_imported_bgp_find(bt, peer->bgp->name)) + if (bgp_vrf == peer->bgp || !bmp_imported_bgp_find(bt, peer->bgp->name)) continue; bmp_send_bt(bt, s); } diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index ad3625242..b6ec8341a 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -4737,7 +4737,7 @@ bgp_evpn_path_nh_info_new(struct bgp_path_info *pi) struct bgp_path_mh_info *mh_info; struct bgp_path_evpn_nh_info *nh_info; - e = bgp_path_info_extra_get(pi); + e = bgp_evpn_path_info_extra_get(pi); /* If mh_info doesn't exist allocate it */ mh_info = e->evpn->mh_info; diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2a28018d4..672c43b37 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -328,6 +328,19 @@ struct bgp_path_info_extra *bgp_path_info_extra_get(struct bgp_path_info *pi) return pi->extra; } +/* Get bgp_path_info extra along with evpn information for the given bgp_path_info. + * This is used for EVPN imported routes like Type-5. + */ +struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *pi) +{ + if (!pi->extra) + pi->extra = bgp_path_info_extra_new(); + if (!pi->extra->evpn) + pi->extra->evpn = XCALLOC(MTYPE_BGP_ROUTE_EXTRA_EVPN, + sizeof(struct bgp_path_info_extra_evpn)); + return pi->extra; +} + bool bgp_path_info_has_valid_label(const struct bgp_path_info *path) { if (!BGP_PATH_INFO_NUM_LABELS(path)) diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 7f4a3b918..c4cbbee0c 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -801,6 +801,7 @@ extern void bgp_path_info_delete(struct bgp_dest *dest, struct bgp_path_info *pi); extern struct bgp_path_info_extra * bgp_path_info_extra_get(struct bgp_path_info *path); +extern struct bgp_path_info_extra *bgp_evpn_path_info_extra_get(struct bgp_path_info *path); extern bool bgp_path_info_has_valid_label(const struct bgp_path_info *path); extern void bgp_path_info_set_flag(struct bgp_dest *dest, struct bgp_path_info *path, uint32_t flag); diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 146630ec6..8e8616c15 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -3375,12 +3375,15 @@ static int bgp_ifp_create(struct interface *ifp) zlog_debug("Rx Intf add VRF %s IF %s", ifp->vrf->name, ifp->name); + /* We don't need to check for vrf->bgp link to add this local MAC + * to the hash table as the tenant VRF might not have the BGP instance. + */ + bgp_mac_add_mac_entry(ifp); + bgp = ifp->vrf->info; if (!bgp) return 0; - bgp_mac_add_mac_entry(ifp); - bgp_update_interface_nbrs(bgp, ifp, ifp); hook_call(bgp_vrf_status_changed, bgp, ifp); diff --git a/doc/developer/packaging-redhat.rst b/doc/developer/packaging-redhat.rst index 803787346..277de5d16 100644 --- a/doc/developer/packaging-redhat.rst +++ b/doc/developer/packaging-redhat.rst @@ -3,7 +3,7 @@ Packaging Red Hat ================= -Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24. +Tested on CentOS 6, CentOS 7, Rocky 8 and Fedora 24. 1. On CentOS 6, refer to :ref:`building-centos6` for details on installing sufficiently up-to-date package versions to enable building FRR. @@ -18,14 +18,14 @@ Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24. yum install rpm-build net-snmp-devel pam-devel libcap-devel - For CentOS 7 and CentOS 8, the package will be built using python3 + For CentOS 7 and Rocky 8, the package will be built using python3 and requires additional python3 packages:: yum install python3-devel python3-sphinx .. note:: - For CentOS 8 you need to install ``platform-python-devel`` package + For Rocky 8 you need to install ``platform-python-devel`` package to provide ``/usr/bin/pathfix.py``:: yum install platform-python-devel @@ -33,7 +33,7 @@ Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24. If ``yum`` is not present on your system, use ``dnf`` instead. - You should enable ``PowerTools`` repo if using CentOS 8 which + You should enable ``PowerTools`` repo if using Rocky 8 which is disabled by default. 4. Checkout FRR:: @@ -88,11 +88,18 @@ Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24. %{!?with_watchfrr: %global with_watchfrr 1 } %{!?with_pathd: %global with_pathd 1 } %{!?with_grpc: %global with_grpc 0 } + %{!?with_rpki: %global with_rpki 1 } + %{!?with_docs: %global with_docs 1 } 8. Build the RPM:: rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec + To override :file:`rpm/SPECS/frr.spec` defaults on the rpmbuild + commandline with: + + rpmbuild --define 'variable value' + If building with RPKI, then download and install the additional RPKI packages from https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact diff --git a/lib/northbound_notif.c b/lib/northbound_notif.c index 10a81d05f..9caca9f6d 100644 --- a/lib/northbound_notif.c +++ b/lib/northbound_notif.c @@ -600,6 +600,7 @@ static void timer_walk_continue(struct event *event) timer_walk_done(args); return; } + group = args->group; } path = group->cur_change->path; diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in index 1ba8f043b..4c0a654c8 100644 --- a/redhat/frr.spec.in +++ b/redhat/frr.spec.in @@ -31,6 +31,8 @@ %{!?with_watchfrr: %global with_watchfrr 1 } %{!?with_pathd: %global with_pathd 1 } %{!?with_grpc: %global with_grpc 0 } +%{!?with_rpki: %global with_rpki 1 } +%{!?with_docs: %global with_docs 1 } # user and group %{!?frr_user: %global frr_user frr } @@ -193,16 +195,22 @@ BuildRequires: pcre2-devel %if 0%{?rhel} && 0%{?rhel} < 7 #python27-devel is available from ius community repo for RedHat/CentOS 6 BuildRequires: python27-devel +%if %{with_docs} BuildRequires: python27-sphinx +%endif %else %if %{use_python2} BuildRequires: python-devel >= 2.7 +%if %{with_docs} BuildRequires: python-sphinx +%endif %else BuildRequires: python3-devel +%if %{with_docs} BuildRequires: python3-sphinx %endif %endif +%endif %if %{with_grpc} BuildRequires: grpc-devel >= 1.16.1 BuildRequires: protobuf-devel >= 3.6.1 @@ -283,6 +291,7 @@ The frr-devel package contains the header and object files necessary for developing OSPF-API and frr applications. +%if %{with_rpki} %package rpki-rtrlib Summary: BGP RPKI support (rtrlib) Group: System Environment/Daemons @@ -295,6 +304,7 @@ against cryptographic information stored in WHOIS databases. This is used to prevent hijacking of networks on the wider internet. It is only relevant to internet service providers using their own autonomous system number. +%endif %package snmp @@ -433,7 +443,9 @@ Adds GRPC support to the individual FRR daemons. --disable-bgp-vnc \ %endif --enable-isisd \ +%if %{with_rpki} --enable-rpki \ +%endif %if %{with_bfdd} --enable-bfdd \ %else @@ -465,9 +477,11 @@ sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/frr-reload.py sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/generate_support_bundle.py %endif +%if %{with_docs} pushd doc make info popd +%endif %install @@ -605,7 +619,9 @@ zebra_spec_add_service fabricd 2618/tcp "Fabricd vty" %__sed -i 's|watchfrr_enable=no|watchfrr_enable=yes|g' %{configdir}/daemons 2> /dev/null || true %endif +%if %{with_docs} /sbin/install-info %{_infodir}/frr.info.gz %{_infodir}/dir +%endif # Create dummy config file if they don't exist so basic functions can be used. if [ ! -e %{configdir}/frr.conf ] && [ ! -e %{configdir}/zebra.conf ]; then @@ -673,7 +689,9 @@ fi /sbin/chkconfig --del frr fi %endif +%if %{with_docs} /sbin/install-info --delete %{_infodir}/frr.info.gz %{_infodir}/dir +%endif %files @@ -690,8 +708,10 @@ fi %dir %attr(755,root,root) %{_localstatedir}/log/frr %dir %attr(750,root,root) %{_runstatedir}/frr %endif -%{_infodir}/frr.info.gz -%{_mandir}/man*/* +%if %{with_docs} + %{_infodir}/frr.info.gz + %{_mandir}/man*/* +%endif %{_sbindir}/zebra %{_sbindir}/staticd %{_sbindir}/ospfd @@ -739,19 +759,9 @@ fi %endif %if %{with_pathd} %{_sbindir}/pathd - %{_libdir}/frr/modules/pathd_pcep.so %endif -%{_libdir}/libfrr.so* -%{_libdir}/libfrrcares* -%{_libdir}/libfrrospf* -%if %{with_fpm} - %{_libdir}/frr/modules/zebra_fpm.so -%endif -%{_libdir}/frr/modules/zebra_cumulus_mlag.so -%{_libdir}/frr/modules/dplane_fpm_nl.so -%{_libdir}/frr/modules/bgpd_bmp.so -%{_libdir}/libfrr_pb.so* -%{_libdir}/libfrrfpm_pb.so* +%{_libdir}/libfrr*.so* +%{_libdir}/frr/modules/*.so %{_libdir}/libmgmt_be_nb.so* %{_bindir}/* %config(noreplace) %{configdir}/[!v]*.conf* @@ -791,6 +801,7 @@ fi %endif +%if %{with_rpki} %post rpki-rtrlib # add rpki module to daemons sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{_sysconfdir}/frr/daemons @@ -798,22 +809,9 @@ sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{_sysconfdir}/frr %postun rpki-rtrlib # remove rpki module from daemons sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons - -%files rpki-rtrlib -%{_libdir}/frr/modules/bgpd_rpki.so - - -%files snmp -%{_libdir}/libfrrsnmp.so* -%{_libdir}/frr/modules/*snmp.so - - -%if %{with_grpc} -%files grpc -%{_libdir}/libfrrgrpc_pb.* -%{_libdir}/frr/modules/grpc.so %endif + %files devel %{_libdir}/lib*.so %dir %{_includedir}/%{name} diff --git a/tests/topotests/bgp_bfd_session/r1/frr.conf b/tests/topotests/bgp_bfd_session/r1/frr.conf index a1560b09f..cea1ff814 100644 --- a/tests/topotests/bgp_bfd_session/r1/frr.conf +++ b/tests/topotests/bgp_bfd_session/r1/frr.conf @@ -11,4 +11,16 @@ router bgp 65000 neighbor 192.168.1.3 bfd neighbor 192.168.1.3 ebgp-multihop 20 neighbor 192.168.1.3 update-source r1-eth0 + neighbor PG peer-group + neighbor PG remote-as auto + neighbor PG bfd + neighbor PG ebgp-multihop 15 + neighbor PG update-source 10.0.0.1 + neighbor 192.168.1.4 peer-group PG + neighbor PG2 peer-group + neighbor PG2 remote-as auto + neighbor PG2 bfd + neighbor PG2 ebgp-multihop 25 + neighbor 192.168.1.5 peer-group PG2 + neighbor 192.168.1.5 update-source 10.0.0.1 exit diff --git a/tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py b/tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py index adf557af7..0dbb2f089 100644 --- a/tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py +++ b/tests/topotests/bgp_bfd_session/test_bgp_bfd_session.py @@ -85,7 +85,29 @@ def test_bgp_bfd_session(): "diagnostic": "ok", "remote-diagnostic": "ok", "type": "dynamic", - } + }, + { + "multihop": True, + "peer": "192.168.1.4", + "local": "10.0.0.1", + "vrf": "default", + "minimum-ttl": 241, + "status": "down", + "diagnostic": "ok", + "remote-diagnostic": "ok", + "type": "dynamic", + }, + { + "multihop": True, + "peer": "192.168.1.5", + "local": "10.0.0.1", + "vrf": "default", + "minimum-ttl": 231, + "status": "down", + "diagnostic": "ok", + "remote-diagnostic": "ok", + "type": "dynamic", + }, ] return topotest.json_cmp(output, expected) diff --git a/tests/topotests/bgp_rpki_topo1/r2/bgp_rpki_valid.json b/tests/topotests/bgp_rpki_topo1/r2/bgp_rpki_valid.json index 016c019d1..966519bfd 100644 --- a/tests/topotests/bgp_rpki_topo1/r2/bgp_rpki_valid.json +++ b/tests/topotests/bgp_rpki_topo1/r2/bgp_rpki_valid.json @@ -1,7 +1,6 @@ { "vrfId": 0, "vrfName": "default", - "tableVersion": 3, "routerId": "192.0.2.2", "defaultLocPrf": 100, "localAS": 65002, @@ -11,7 +10,6 @@ "origin": "IGP", "metric": 0, "valid": true, - "version": 2, "rpkiValidationState": "valid", "bestpath": { "overall": true, @@ -40,7 +38,6 @@ "origin": "IGP", "metric": 0, "valid": true, - "version": 3, "rpkiValidationState": "valid", "bestpath": { "overall": true, diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 3ea63ce2a..a138e4e23 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1757,12 +1757,13 @@ def compare_context_objects(newconf, running): delete_bgpd = True lines_to_del.append((running_ctx_keys, None)) - # We cannot do 'no interface' or 'no vrf' in FRR, and so deal with it - elif ( - running_ctx_keys[0].startswith("interface") - or running_ctx_keys[0].startswith("vrf") - or running_ctx_keys[0].startswith("router pim") - ): + elif running_ctx_keys[0].startswith("interface"): + lines_to_del.append((running_ctx_keys, None)) + + # We cannot do 'no vrf' in FRR, and so deal with it + elif running_ctx_keys[0].startswith("vrf") or running_ctx_keys[ + 0 + ].startswith("router pim"): for line in running_ctx.lines: lines_to_del.append((running_ctx_keys, line)) |