Files
frr/0010-nhrpd-zebra-Read-GRE-addresses-only-if-sent.patch
2024-05-19 21:51:40 +02:00

50 lines
1.6 KiB
Diff

From 114bd532ac0c3b6d819f516eb41021eb250b65bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zoran=20Peri=C4=8Di=C4=87?= <zpericic@netst.org>
Date: Wed, 15 Sep 2021 19:44:56 +0200
Subject: [PATCH 10/11] nhrpd, zebra: Read GRE addresses only if sent
GRE addresses are not send if interface is missing in kernel. We
should first check if they have been sent.
---
nhrpd/nhrp_route.c | 7 ++++---
zebra/zapi_msg.c | 2 --
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c
index 698c6d0cdf..2e7923bf33 100644
--- a/nhrpd/nhrp_route.c
+++ b/nhrpd/nhrp_route.c
@@ -493,12 +493,13 @@ int nhrp_gre_update(ZAPI_CALLBACK_ARGS)
STREAM_GETL(s, gre_info.okey);
STREAM_GETL(s, gre_info.ifindex_link);
STREAM_GETL(s, gre_info.vrfid_link);
- STREAM_GETL(s, gre_info.vtep_ip.s_addr);
- STREAM_GETL(s, gre_info.vtep_ip_remote.s_addr);
if (gre_info.ifindex == IFINDEX_INTERNAL)
val = NULL;
- else
+ else {
val = hash_lookup(nhrp_gre_list, &gre_info);
+ STREAM_GETL(s, gre_info.vtep_ip.s_addr);
+ STREAM_GETL(s, gre_info.vtep_ip_remote.s_addr);
+ }
if (val) {
if (gre_info.vtep_ip.s_addr != val->vtep_ip.s_addr ||
gre_info.vrfid_link != val->vrfid_link ||
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 68bb9783f8..72d06d71ea 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -3618,8 +3618,6 @@ static inline void zebra_gre_get(ZAPI_HANDLER_ARGS)
stream_putl(s, 0);
stream_putl(s, IFINDEX_INTERNAL);
stream_putl(s, VRF_UNKNOWN);
- stream_putl(s, 0);
- stream_putl(s, 0);
}
/* Write packet size. */
stream_putw_at(s, 0, stream_get_endp(s));
--
2.41.0