From 575c8a5233d5867ca708ca9d706217186084a9f4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Jul 2022 12:07:47 +0200 Subject: [PATCH] interfaces: add missing scope to GIF host route; closes #5884 Although we could agree that we should not emit link locals without scope attached and/or that system_host_route() should fix this by itself, there is only caller of system_host_route() with the same problem and that one handles it correctly already. Since we do not know the side effects and it is late into the 22.7 development with RC1 already out that we fix this issue here fully with the least impact possible. --- src/etc/inc/interfaces.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 83a08ba34..bde321e96 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -640,6 +640,9 @@ function _interfaces_gif_configure($gif) } elseif (is_ipaddrv6($gif['remote-addr'])) { $realifip = get_interface_ipv6(!empty($gif['ipaddr']) ? $gif['ipaddr'] : $gif['if']); $realifgw = $gateways->getInterfaceGateway(explode('_vip', $gif['if'])[0], 'inet6'); + if (is_linklocal($realifgw) && strpos($realifgw, '%') === false) { + $realifgw .= '%' . get_real_interface(explode('_vip', $gif['if'])[0], 'inet6'); + } } interfaces_bring_up(get_real_interface(explode('_vip', $gif['if'])[0])); /* XXX overreach? */