summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2021-03-11 15:33:41 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2021-04-30 10:33:18 +0200
commit62b4b7e44ae72cbd611a78cd7abe8558366af21c (patch)
tree254284fcdf2a9c7d4fca1c19d8645fafe2222c03 /zebra/zapi_msg.c
parent372b887859b7e5739137b02a1cecf2ea702ba586 (diff)
zebra: new dplane action to set gre link interface
This action is initiated by nhrp and has been stubbed when moving to zebra. Now, a netlink request is forged to set the link interface of a gre interface if that gre interface does not have already a link interface. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index d36c6becd7..22a6bf496b 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -3435,22 +3435,40 @@ static inline void zebra_gre_source_set(ZAPI_HANDLER_ARGS)
vrf_id_t link_vrf_id;
struct interface *ifp;
struct interface *ifp_link;
- ns_id_t ns_id;
vrf_id_t vrf_id = zvrf->vrf->vrf_id;
+ struct zebra_if *zif, *gre_zif;
+ struct zebra_l2info_gre *gre_info;
s = msg;
STREAM_GETL(s, idx);
ifp = if_lookup_by_index(idx, vrf_id);
STREAM_GETL(s, link_idx);
STREAM_GETL(s, link_vrf_id);
+
ifp_link = if_lookup_by_index(link_idx, link_vrf_id);
if (!ifp_link || !ifp) {
zlog_warn("GRE (index %u, VRF %u) or GRE link interface (index %u, VRF %u) not found, when setting GRE params",
idx, vrf_id, link_idx, link_vrf_id);
return;
}
- ns_id = zvrf->zns->ns_id;
- kernel_configure_if_link(ifp, ifp_link, ns_id);
+
+ if (!IS_ZEBRA_IF_GRE(ifp))
+ return;
+
+ gre_zif = (struct zebra_if *)ifp->info;
+ zif = (struct zebra_if *)ifp_link->info;
+ if (!zif || !gre_zif)
+ return;
+
+ gre_info = &zif->l2info.gre;
+ if (!gre_info)
+ return;
+
+ /* if gre link already set */
+ if (gre_zif->link && gre_zif->link == ifp_link)
+ return;
+
+ dplane_gre_set(ifp, ifp_link);
stream_failure:
return;