diff options
6 files changed, 11 insertions, 366 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index a4c2b931..8b33d506 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -211,6 +211,11 @@ RUN export RTRLIB_VERSION="0.8.0" export ARCH=$(dpkg-architecture -qDEB_HOST_ARC dpkg-buildpackage -uc -us -tc -b && \ dpkg -i ../librtr0*_${ARCH}.deb ../librtr-dev*_${ARCH}.deb ../rtr-tools*_${ARCH}.deb +RUN export LIBYANG_VERSION="v2.1.80" export ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) && \ + git clone https://github.com/CESNET/libyang.git /tmp/libyang && cd /tmp/libyang && \ + pipx run apkg build -i && find pkg/pkgs -type f -name *.deb -exec mv -t .. {} + && \ + dpkg -i ../libyang*.deb + # Packages needed for vyos-1x RUN pip install --break-system-packages \ git+https://github.com/aristanetworks/j2lint.git@341b5d5db86 \ diff --git a/packages/frr/.gitignore b/packages/frr/.gitignore index 9aefeba5..8afd14e8 100644 --- a/packages/frr/.gitignore +++ b/packages/frr/.gitignore @@ -1,2 +1,3 @@ frr/ rtrlib/ +libyang/ diff --git a/packages/frr/Jenkinsfile b/packages/frr/Jenkinsfile index 0e82657d..269aaf9f 100644 --- a/packages/frr/Jenkinsfile +++ b/packages/frr/Jenkinsfile @@ -21,12 +21,16 @@ @Library('vyos-build@current')_ def pkgList = [ + ['name': 'libyang', + 'scmCommit': 'v2.1.80', + 'scmUrl': 'https://github.com/CESNET/libyang.git', + 'buildCmd': 'pipx run apkg build -i && find pkg/pkgs -type f -name *.deb -exec mv -t .. {} +'], ['name': 'rtrlib', 'scmCommit': 'v0.8.0', 'scmUrl': 'https://github.com/rtrlib/rtrlib.git', 'buildCmd': 'sudo mk-build-deps --install --tool "apt-get --yes --no-install-recommends"; dpkg-buildpackage -uc -us -tc -b'], ['name': 'frr', - 'scmCommit': 'stable/8.5', + 'scmCommit': 'stable/9.0', 'scmUrl': 'https://github.com/FRRouting/frr.git', 'buildCmd': 'sudo mk-build-deps --install --tool "apt-get --yes --no-install-recommends"; cd ..; ./build-frr.sh'], ] diff --git a/packages/frr/patches/0001-ospfd-Support-show-advertise-router-in-show-ip-ospf-.patch b/packages/frr/patches/0001-ospfd-Support-show-advertise-router-in-show-ip-ospf-.patch deleted file mode 100644 index 027309c9..00000000 --- a/packages/frr/patches/0001-ospfd-Support-show-advertise-router-in-show-ip-ospf-.patch +++ /dev/null @@ -1,232 +0,0 @@ -From 8113b8d3ba0646715a3b922a2a2afc5bc25375d7 Mon Sep 17 00:00:00 2001 -From: Zhiyuan Wan <h@iloli.bid> -Date: Wed, 29 Mar 2023 23:05:20 +0800 -Subject: [PATCH 1/3] ospfd: Support show advertise router in 'show ip ospf - route' command - -Users can now use 'show ip ospf route [detail]' command to show the -originator of each OSPF route item. - -Signed-off-by: Zhiyuan Wan <h@iloli.bid> ---- - doc/user/ospfd.rst | 7 +++--- - ospfd/ospf_vty.c | 56 ++++++++++++++++++++++++++++++++++++---------- - 2 files changed, 48 insertions(+), 15 deletions(-) - -diff --git a/doc/user/ospfd.rst b/doc/user/ospfd.rst -index b69230b99..419928d9f 100644 ---- a/doc/user/ospfd.rst -+++ b/doc/user/ospfd.rst -@@ -826,10 +826,11 @@ Showing Information - - Show the OSPF database summary. - --.. clicmd:: show ip ospf route [json] -+.. clicmd:: show ip ospf route [detail] [json] - - Show the OSPF routing table, as determined by the most recent SPF -- calculation. -+ calculation. If detail is specified, each routing item's -+ advertiser will be show up. - - .. clicmd:: show ip ospf [vrf <NAME|all>] border-routers [json] - -@@ -840,7 +841,7 @@ Showing Information - - .. clicmd:: show ip ospf graceful-restart helper [detail] [json] - -- Displays the Grcaeful Restart Helper details including helper -+ Displays the Graceful Restart Helper details including helper - config changes. - - .. _opaque-lsa: -diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c -index 469e9955e..40b38e18b 100644 ---- a/ospfd/ospf_vty.c -+++ b/ospfd/ospf_vty.c -@@ -10553,7 +10553,7 @@ static void config_write_stub_router(struct vty *vty, struct ospf *ospf) - - static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, - struct route_table *rt, -- json_object *json) -+ json_object *json, bool detail) - { - struct route_node *rn; - struct ospf_route * or ; -@@ -10678,6 +10678,10 @@ static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, - ifindex2ifname( - path->ifindex, - ospf->vrf_id)); -+ json_object_string_addf( -+ json_nexthop, -+ "adv", "%pI4", -+ &path->adv_router); - } else { - vty_out(vty, - "%24s via %pI4, %s\n", -@@ -10687,6 +10691,11 @@ static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, - path->ifindex, - ospf->vrf_id)); - } -+ if (detail && !json) -+ vty_out(vty, -+ "%24s adv %pI4\n", -+ "", -+ &path->adv_router); - } - } - } -@@ -10841,7 +10850,7 @@ static void show_ip_ospf_route_router(struct vty *vty, struct ospf *ospf, - - static void show_ip_ospf_route_external(struct vty *vty, struct ospf *ospf, - struct route_table *rt, -- json_object *json) -+ json_object *json, bool detail) - { - struct route_node *rn; - struct ospf_route *er; -@@ -10945,6 +10954,10 @@ static void show_ip_ospf_route_external(struct vty *vty, struct ospf *ospf, - ifindex2ifname( - path->ifindex, - ospf->vrf_id)); -+ json_object_string_addf( -+ json_nexthop, "adv", -+ "%pI4", -+ &path->adv_router); - } else { - vty_out(vty, - "%24s via %pI4, %s\n", -@@ -10954,6 +10967,10 @@ static void show_ip_ospf_route_external(struct vty *vty, struct ospf *ospf, - path->ifindex, - ospf->vrf_id)); - } -+ if (detail && !json) -+ vty_out(vty, -+ "%24s adv %pI4\n", "", -+ &path->adv_router); - } - } - } -@@ -11240,7 +11257,8 @@ DEFUN (show_ip_ospf_instance_border_routers, - } - - static int show_ip_ospf_route_common(struct vty *vty, struct ospf *ospf, -- json_object *json, uint8_t use_vrf) -+ json_object *json, uint8_t use_vrf, -+ bool detail) - { - json_object *json_vrf = NULL; - -@@ -11268,7 +11286,8 @@ static int show_ip_ospf_route_common(struct vty *vty, struct ospf *ospf, - } - - /* Show Network routes. */ -- show_ip_ospf_route_network(vty, ospf, ospf->new_table, json_vrf); -+ show_ip_ospf_route_network(vty, ospf, ospf->new_table, json_vrf, -+ detail); - - /* Show Router routes. */ - show_ip_ospf_route_router(vty, ospf, ospf->new_rtrs, json_vrf); -@@ -11279,7 +11298,7 @@ static int show_ip_ospf_route_common(struct vty *vty, struct ospf *ospf, - - /* Show AS External routes. */ - show_ip_ospf_route_external(vty, ospf, ospf->old_external_route, -- json_vrf); -+ json_vrf, detail); - - if (json) { - if (use_vrf) { -@@ -11297,13 +11316,14 @@ static int show_ip_ospf_route_common(struct vty *vty, struct ospf *ospf, - - DEFUN (show_ip_ospf_route, - show_ip_ospf_route_cmd, -- "show ip ospf [vrf <NAME|all>] route [json]", -+ "show ip ospf [vrf <NAME|all>] route [detail] [json]", - SHOW_STR - IP_STR - "OSPF information\n" - VRF_CMD_HELP_STR - "All VRFs\n" - "OSPF routing table\n" -+ "Detailed information\n" - JSON_STR) - { - struct ospf *ospf = NULL; -@@ -11312,14 +11332,19 @@ DEFUN (show_ip_ospf_route, - bool all_vrf = false; - int ret = CMD_SUCCESS; - int inst = 0; -+ int idx = 0; - int idx_vrf = 0; - uint8_t use_vrf = 0; - bool uj = use_json(argc, argv); -+ bool detail = false; - json_object *json = NULL; - - if (uj) - json = json_object_new_object(); - -+ if (argv_find(argv, argc, "detail", &idx)) -+ detail = true; -+ - OSPF_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf); - - /* vrf input is provided could be all or specific vrf*/ -@@ -11333,8 +11358,8 @@ DEFUN (show_ip_ospf_route, - if (!ospf->oi_running) - continue; - ospf_output = true; -- ret = show_ip_ospf_route_common(vty, ospf, json, -- use_vrf); -+ ret = show_ip_ospf_route_common( -+ vty, ospf, json, use_vrf, detail); - } - - if (uj) { -@@ -11371,7 +11396,8 @@ DEFUN (show_ip_ospf_route, - } - - if (ospf) { -- ret = show_ip_ospf_route_common(vty, ospf, json, use_vrf); -+ ret = show_ip_ospf_route_common(vty, ospf, json, use_vrf, -+ detail); - /* Keep Non-pretty format */ - if (uj) - vty_out(vty, "%s\n", -@@ -11387,16 +11413,22 @@ DEFUN (show_ip_ospf_route, - - DEFUN (show_ip_ospf_instance_route, - show_ip_ospf_instance_route_cmd, -- "show ip ospf (1-65535) route", -+ "show ip ospf (1-65535) route [detail]", - SHOW_STR - IP_STR - "OSPF information\n" - "Instance ID\n" -- "OSPF routing table\n") -+ "OSPF routing table\n" -+ "Detailed information\n") - { - int idx_number = 3; -+ int idx = 0; - struct ospf *ospf; - unsigned short instance = 0; -+ bool detail = false; -+ -+ if (argv_find(argv, argc, "detail", &idx)) -+ detail = true; - - instance = strtoul(argv[idx_number]->arg, NULL, 10); - if (instance != ospf_instance) -@@ -11406,7 +11438,7 @@ DEFUN (show_ip_ospf_instance_route, - if (!ospf || !ospf->oi_running) - return CMD_SUCCESS; - -- return show_ip_ospf_route_common(vty, ospf, NULL, 0); -+ return show_ip_ospf_route_common(vty, ospf, NULL, 0, detail); - } - - --- -2.30.2 - diff --git a/packages/frr/patches/0002-ospfd-Fix-wrong-advertise-router-calculation-in-tran.patch b/packages/frr/patches/0002-ospfd-Fix-wrong-advertise-router-calculation-in-tran.patch deleted file mode 100644 index b78fdf04..00000000 --- a/packages/frr/patches/0002-ospfd-Fix-wrong-advertise-router-calculation-in-tran.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 29f1a00109eba4a5f23662b377d372f92735b2b6 Mon Sep 17 00:00:00 2001 -From: Zhiyuan Wan <h@iloli.bid> -Date: Mon, 3 Apr 2023 14:35:14 +0800 -Subject: [PATCH 2/3] ospfd: Fix wrong advertise router calculation in transit - network - -The ospfd mistakenly copy advertise router from vertex->id, which may -not be correct in an OSPF transit network. - -Signed-off-by: Zhiyuan Wan <h@iloli.bid> ---- - ospfd/ospf_route.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c -index fea9f79bf..c98790b5e 100644 ---- a/ospfd/ospf_route.c -+++ b/ospfd/ospf_route.c -@@ -864,7 +864,7 @@ void ospf_route_copy_nexthops_from_vertex(struct ospf_area *area, - || area->spf_dry_run) { - path = ospf_path_new(); - path->nexthop = nexthop->router; -- path->adv_router = v->id; -+ path->adv_router = v->lsa->adv_router; - - if (oi) { - path->ifindex = oi->ifp->ifindex; --- -2.30.2 - diff --git a/packages/frr/patches/0003-ospfd-Support-show-intra-area-network-type-in-show-i.patch b/packages/frr/patches/0003-ospfd-Support-show-intra-area-network-type-in-show-i.patch deleted file mode 100644 index cfe5c15c..00000000 --- a/packages/frr/patches/0003-ospfd-Support-show-intra-area-network-type-in-show-i.patch +++ /dev/null @@ -1,103 +0,0 @@ -From fae730bd95bcd508e087dd11991d8c6c201d581c Mon Sep 17 00:00:00 2001 -From: Zhiyuan Wan <h@iloli.bid> -Date: Mon, 3 Apr 2023 16:21:15 +0800 -Subject: [PATCH 3/3] ospfd: Support show intra-area network type in 'show ip - ospf route' command - -User can now use 'show ip ospf route detail' command to distinguish -intra-area stub network and transit network. -Transit network will be displayed as 'N T prefix ...'. - -NOTICE: Json output format has been changed, intra-area stub networks -still has 'N' routeType, transit networks has 'N T' routeType. And -'adv' (means advertise router) change to 'advertisedRouter'. - -Signed-off-by: Zhiyuan Wan <h@iloli.bid> ---- - ospfd/ospf_route.c | 2 ++ - ospfd/ospf_route.h | 2 ++ - ospfd/ospf_vty.c | 15 +++++++++------ - 3 files changed, 13 insertions(+), 6 deletions(-) - -diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c -index c98790b5e..cc7f0c525 100644 ---- a/ospfd/ospf_route.c -+++ b/ospfd/ospf_route.c -@@ -63,6 +63,7 @@ struct ospf_route *ospf_route_new(void) - - new->paths = list_new(); - new->paths->del = (void (*)(void *))ospf_path_free; -+ new->u.std.transit = false; - - return new; - } -@@ -515,6 +516,7 @@ void ospf_intra_add_transit(struct route_table *rt, struct vertex *v, - or->cost = v->distance; - or->type = OSPF_DESTINATION_NETWORK; - or->u.std.origin = (struct lsa_header *)lsa; -+ or->u.std.transit = true; - - ospf_route_copy_nexthops_from_vertex(area, or, v); - -diff --git a/ospfd/ospf_route.h b/ospfd/ospf_route.h -index fa9478fce..c75d694d3 100644 ---- a/ospfd/ospf_route.h -+++ b/ospfd/ospf_route.h -@@ -84,6 +84,8 @@ struct route_standard { - - /* */ - uint8_t flags; /* From router-LSA */ -+ -+ bool transit; - }; - - struct route_external { -diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c -index 40b38e18b..30048cb8d 100644 ---- a/ospfd/ospf_vty.c -+++ b/ospfd/ospf_vty.c -@@ -10612,16 +10612,17 @@ static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, - case OSPF_PATH_INTRA_AREA: - if (json) { - json_object_string_add(json_route, "routeType", -- "N"); -+ or->u.std.transit ? "N T" -+ : "N"); - json_object_int_add(json_route, "cost", - or->cost); - json_object_string_addf(json_route, "area", - "%pI4", - &or->u.std.area_id); - } else { -- vty_out(vty, "N %-18s [%d] area: %pI4\n", -- buf1, or->cost, -- &or->u.std.area_id); -+ vty_out(vty, "N %s %-18s [%d] area: %pI4\n", -+ or->u.std.transit && detail ? "T" : " ", -+ buf1, or->cost, & or->u.std.area_id); - } - break; - default: -@@ -10680,7 +10681,8 @@ static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, - ospf->vrf_id)); - json_object_string_addf( - json_nexthop, -- "adv", "%pI4", -+ "advertisedRouter", -+ "%pI4", - &path->adv_router); - } else { - vty_out(vty, -@@ -10955,7 +10957,8 @@ static void show_ip_ospf_route_external(struct vty *vty, struct ospf *ospf, - path->ifindex, - ospf->vrf_id)); - json_object_string_addf( -- json_nexthop, "adv", -+ json_nexthop, -+ "advertisedRouter", - "%pI4", - &path->adv_router); - } else { --- -2.30.2 - |