summaryrefslogtreecommitdiff
path: root/zebra/zebra_l2.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-05-05 07:57:04 -0400
committerGitHub <noreply@github.com>2021-05-05 07:57:04 -0400
commit3d4b999fab50a4f08d2c4257ec059218a90ed29f (patch)
tree135eea80ddb75fb83ff291f43b7f1a87572cf5d6 /zebra/zebra_l2.c
parent48c20391997a9809c710d4669a05f9eee8b5bff8 (diff)
parentdee1c6c3384ca9f22f2920263640f4c4dc9eb67c (diff)
Merge pull request #8237 from pguibert6WIND/nhrp_use_zebra_2
Nhrp use zebra 2
Diffstat (limited to 'zebra/zebra_l2.c')
-rw-r--r--zebra/zebra_l2.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c
index c3fbff2723..71fac556e1 100644
--- a/zebra/zebra_l2.c
+++ b/zebra/zebra_l2.c
@@ -290,6 +290,32 @@ void zebra_l2_vlanif_update(struct interface *ifp,
}
/*
+ * Update L2 info for a GRE interface. This is called upon interface
+ * addition as well as update. Upon add/update, need to inform
+ * clients about GRE information.
+ */
+void zebra_l2_greif_add_update(struct interface *ifp,
+ struct zebra_l2info_gre *gre_info, int add)
+{
+ struct zebra_if *zif;
+ struct in_addr old_vtep_ip;
+
+ zif = ifp->info;
+ assert(zif);
+
+ if (add) {
+ memcpy(&zif->l2info.gre, gre_info, sizeof(*gre_info));
+ return;
+ }
+
+ old_vtep_ip = zif->l2info.gre.vtep_ip;
+ if (IPV4_ADDR_SAME(&old_vtep_ip, &gre_info->vtep_ip))
+ return;
+
+ zif->l2info.gre.vtep_ip = gre_info->vtep_ip;
+}
+
+/*
* Update L2 info for a VxLAN interface. This is called upon interface
* addition as well as update. Upon add, need to invoke the VNI create
* function. Upon update, the params of interest are the local tunnel