diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-12-19 18:33:56 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-30 10:33:15 +0200 |
commit | 077c07cc58be1fbbe28a2df71cd884af87b121a7 (patch) | |
tree | 71ca990630d121074fa3ae61acf0df0ea75d56c6 /zebra/zebra_l2.c | |
parent | Merge pull request #8570 from qlyoung/revert-ringbuf-readv (diff) | |
download | frr-077c07cc58be1fbbe28a2df71cd884af87b121a7.tar.xz frr-077c07cc58be1fbbe28a2df71cd884af87b121a7.zip |
zebra: storage of gre information in zebra layer
zebra is able to get information about gre tunnels.
zebra_gre file is created to handle hooks, but is not yet used.
also, debug zebra gre command is done to add gre traces.
A zebra_gre file is used for complementary actions that may be needed.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_l2.c')
-rw-r--r-- | zebra/zebra_l2.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c index c3fbff272..71fac556e 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 |