mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-05-13 05:44:34 +02:00
44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
From d8ab9b978777d4e3513f3bb7ccae38544dc66e66 Mon Sep 17 00:00:00 2001
|
|
From: Kaarle Ritvanen <kunkku@alpinelinux.org>
|
|
Date: Wed, 19 Apr 2023 17:40:39 +0300
|
|
Subject: [PATCH 3/4] nhrpd: ignore non-host addresses on NHRP ifaces
|
|
|
|
Contemporary kernels automatically add link-local IPv6 addresses on GRE
|
|
interfaces. This patch makes nhrpd ignore such and other non-host
|
|
addresses when selecting the best protocol address, instead of
|
|
discarding such an address after the selection.
|
|
---
|
|
nhrpd/nhrp_interface.c | 10 +++-------
|
|
1 file changed, 3 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
|
|
index 4ea80764..0d9a62d0 100644
|
|
--- a/nhrpd/nhrp_interface.c
|
|
+++ b/nhrpd/nhrp_interface.c
|
|
@@ -178,6 +178,9 @@ static void nhrp_interface_update_address(struct interface *ifp, afi_t afi, int
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, cnode, c)) {
|
|
if (PREFIX_FAMILY(c->address) != family)
|
|
continue;
|
|
+ /* On NHRP interfaces a host prefix is required */
|
|
+ if (if_ad->configured && c->address->prefixlen != 8 * prefix_blen(c->address))
|
|
+ continue;
|
|
if (best == NULL) {
|
|
best = c;
|
|
continue;
|
|
@@ -196,13 +199,6 @@ static void nhrp_interface_update_address(struct interface *ifp, afi_t afi, int
|
|
continue;
|
|
}
|
|
|
|
- /* On NHRP interfaces a host prefix is required */
|
|
- if (best && if_ad->configured && best->address->prefixlen != 8 * prefix_blen(best->address)) {
|
|
- zlog_notice("%s: %s is not a host prefix", ifp->name,
|
|
- prefix2str(best->address, buf, sizeof buf));
|
|
- best = NULL;
|
|
- }
|
|
-
|
|
/* Update address if it changed */
|
|
if (best)
|
|
prefix2sockunion(best->address, &addr);
|
|
--
|
|
2.40.1
|
|
|