summaryrefslogtreecommitdiff
path: root/ldpd/ldp_zebra.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-04-29 22:44:25 -0300
committerGitHub <noreply@github.com>2020-04-29 22:44:25 -0300
commit31b5355d6f643a7ce35a8aa2b293d0421ea9c579 (patch)
treed3bb871eb52de536bcc7f55fa0bb3ae0ee5079ae /ldpd/ldp_zebra.c
parenta276f04a3f97b4d5931305927e199e85c8ba0ecb (diff)
parent2d1aa1e8875ea38d6d2c2c79cca849399044261a (diff)
Merge pull request #6241 from volta-networks/fix_ldp_acl
ldpd: fix ACL rule modification
Diffstat (limited to 'ldpd/ldp_zebra.c')
-rw-r--r--ldpd/ldp_zebra.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index 28e56ecd64..8638be83db 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -44,6 +44,7 @@ static int ldp_interface_address_delete(ZAPI_CALLBACK_ARGS);
static int ldp_zebra_read_route(ZAPI_CALLBACK_ARGS);
static int ldp_zebra_read_pw_status_update(ZAPI_CALLBACK_ARGS);
static void ldp_zebra_connected(struct zclient *);
+static void ldp_zebra_filter_update(struct access_list *access);
static struct zclient *zclient;
@@ -525,6 +526,22 @@ ldp_zebra_connected(struct zclient *zclient)
ZEBRA_ROUTE_ALL, 0, VRF_DEFAULT);
}
+static void
+ldp_zebra_filter_update(struct access_list *access)
+{
+ struct ldp_access laccess;
+
+ if (access && access->name[0] != '\0') {
+ strlcpy(laccess.name, access->name, sizeof(laccess.name));
+ laccess.type = access->type;
+ debug_evt("%s ACL update filter name %s type %d", __func__,
+ access->name, access->type);
+
+ main_imsg_compose_both(IMSG_FILTER_UPDATE, &laccess,
+ sizeof(laccess));
+ }
+}
+
extern struct zebra_privs_t ldpd_privs;
void
@@ -545,6 +562,10 @@ ldp_zebra_init(struct thread_master *master)
zclient->redistribute_route_add = ldp_zebra_read_route;
zclient->redistribute_route_del = ldp_zebra_read_route;
zclient->pw_status_update = ldp_zebra_read_pw_status_update;
+
+ /* Access list initialize. */
+ access_list_add_hook(ldp_zebra_filter_update);
+ access_list_delete_hook(ldp_zebra_filter_update);
}
void