summaryrefslogtreecommitdiff
path: root/zebra/zebra_fpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_fpm.c')
-rw-r--r--zebra/zebra_fpm.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 855e19dc45..43958fdfde 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -292,6 +292,9 @@ static void zfpm_start_connect_timer(const char *reason);
static void zfpm_start_stats_timer(void);
static void zfpm_mac_info_del(struct fpm_mac_info_t *fpm_mac);
+static const char ipv4_ll_buf[16] = "169.254.0.1";
+union g_addr ipv4ll_gateway;
+
/*
* zfpm_thread_should_yield
*/
@@ -1553,8 +1556,9 @@ static void zfpm_mac_info_del(struct fpm_mac_info_t *fpm_mac)
* This function checks if we already have enqueued an update for this RMAC,
* If yes, update the same fpm_mac_info_t. Else, create and enqueue an update.
*/
-static int zfpm_trigger_rmac_update(zebra_mac_t *rmac, zebra_l3vni_t *zl3vni,
- bool delete, const char *reason)
+static int zfpm_trigger_rmac_update(struct zebra_mac *rmac,
+ struct zebra_l3vni *zl3vni, bool delete,
+ const char *reason)
{
struct fpm_mac_info_t *fpm_mac, key;
struct interface *vxlan_if, *svi_if;
@@ -1637,8 +1641,8 @@ static int zfpm_trigger_rmac_update(zebra_mac_t *rmac, zebra_l3vni_t *zl3vni,
static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *bucket,
void *args)
{
- zebra_mac_t *zrmac = (zebra_mac_t *)bucket->data;
- zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)args;
+ struct zebra_mac *zrmac = (struct zebra_mac *)bucket->data;
+ struct zebra_l3vni *zl3vni = (struct zebra_l3vni *)args;
zfpm_trigger_rmac_update(zrmac, zl3vni, false, "RMAC added");
}
@@ -1650,7 +1654,7 @@ static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *bucket,
*/
static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args)
{
- zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)bucket->data;
+ struct zebra_l3vni *zl3vni = (struct zebra_l3vni *)bucket->data;
hash_iterate(zl3vni->rmac_table, zfpm_trigger_rmac_update_wrapper,
(void *)zl3vni);
@@ -1992,6 +1996,10 @@ static int zfpm_init(struct thread_master *master)
zfpm_stats_init(&zfpm_g->last_ivl_stats);
zfpm_stats_init(&zfpm_g->cumulative_stats);
+ memset(&ipv4ll_gateway, 0, sizeof(ipv4ll_gateway));
+ if (inet_pton(AF_INET, ipv4_ll_buf, &ipv4ll_gateway.ipv4) != 1)
+ zlog_warn("inet_pton failed for %s", ipv4_ll_buf);
+
install_node(&zebra_node);
install_element(ENABLE_NODE, &show_zebra_fpm_stats_cmd);
install_element(ENABLE_NODE, &clear_zebra_fpm_stats_cmd);