From 02f8cf776940f04671e592e0abf719e75aa93a7a Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 21 Dec 2023 14:25:19 +0200 Subject: [PATCH 1/3] zebra: Push all configured IP addresses when the interface comes up Let's say we this: ``` $ ip link set down dev r1-eth0 $ ip link set up dev r1-eth0 ``` But at the same time we have this interface configured by the FRR too: ``` interface r1-eth0 ipv6 address fe80:1::1/64 exit ``` We never re-add fe80:1::1/64, when the interface comes up, and we have a strange situation where NHT stops working and other stuff depending on NHT stops too (BGP peering, etc.). Closes: https://github.com/FRRouting/frr/issues/15050 Signed-off-by: Donatas Abraitis --- zebra/interface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zebra/interface.c b/zebra/interface.c index 39d24f1883..41ef5e436d 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1054,6 +1054,8 @@ void if_up(struct interface *ifp, bool install_connected) event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0, &zif->speed_update); event_ignore_late_timer(zif->speed_update); + + if_addr_wakeup(ifp); } /* Interface goes down. We have to manage different behavior of based From f95479b15072db0de63a0d7d25cfda7ccdd4a324 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 21 Dec 2023 15:08:52 +0200 Subject: [PATCH 2/3] zebra: Show IPv6 link-local interfaces under `show interface` output Despite if it's managed by FRR or the kernel, show it. Signed-off-by: Donatas Abraitis --- zebra/interface.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zebra/interface.c b/zebra/interface.c index 41ef5e436d..bbb72675f1 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -2762,8 +2762,7 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) } frr_each (if_connected, ifp->connected, connected) { - if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL) - && (connected->address->family == AF_INET6)) + if (connected->address->family == AF_INET6) connected_dump_vty(vty, NULL, connected); } @@ -3139,8 +3138,7 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp, } frr_each (if_connected, ifp->connected, connected) { - if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL) - && (connected->address->family == AF_INET6)) + if (connected->address->family == AF_INET6) connected_dump_vty(vty, json_addrs, connected); } From cb777f9576d7031bee30c1b90bf5c9c6eda3fe58 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 21 Dec 2023 15:13:16 +0200 Subject: [PATCH 3/3] zebra: Show IPv6 link-local interfaces under `show interface brief` output Despite if it's managed by FRR or the kernel, show it. If the system has only link-local addresses, we should show it unless it's a secondary one. Signed-off-by: Donatas Abraitis --- zebra/interface.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/zebra/interface.c b/zebra/interface.c index bbb72675f1..6115ed0a02 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -2500,28 +2500,21 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf) v6_list_size++; } frr_each (if_connected, ifp->connected, connected) { - if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL) - && !CHECK_FLAG(connected->flags, - ZEBRA_IFA_SECONDARY) - && (connected->address->family == AF_INET6)) { + if (!CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY) && + (connected->address->family == AF_INET6)) { p = connected->address; - /* Don't print link local pfx */ - if (!IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6)) { - if (first_pfx_printed) { - /* padding to prepare row only - * for ip addr */ - vty_out(vty, "%-40s", ""); - if (v6_list_size > 1) - vty_out(vty, "+ "); - vty_out(vty, "%pFX\n", p); - } else { - if (v6_list_size > 1) - vty_out(vty, "+ "); - vty_out(vty, "%pFX\n", p); - } - first_pfx_printed = true; - break; + if (first_pfx_printed) { + vty_out(vty, "%-40s", ""); + if (v6_list_size > 1) + vty_out(vty, "+ "); + vty_out(vty, "%pFX\n", p); + } else { + if (v6_list_size > 1) + vty_out(vty, "+ "); + vty_out(vty, "%pFX\n", p); } + first_pfx_printed = true; + break; } } if (!first_pfx_printed) @@ -2549,12 +2542,7 @@ static void ifs_dump_brief_vty_json(json_object *json, struct vrf *vrf) json_addrs = json_object_new_array(); json_object_object_add(json_if, "addresses", json_addrs); frr_each (if_connected, ifp->connected, connected) { - if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL) - && !CHECK_FLAG(connected->flags, - ZEBRA_IFA_SECONDARY) - && !(connected->address->family == AF_INET6 - && IN6_IS_ADDR_LINKLOCAL( - &connected->address->u.prefix6))) { + if (!CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY)) { char buf[PREFIX2STR_BUFFER]; json_array_string_add(