]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zapi_msg.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / zebra / zapi_msg.c
index 6990fd95f522e38b42ccb0949787dae9dfdf2e27..26a3cd5b42a03fca4dd06072525006c85cd3f5c9 100644 (file)
@@ -62,6 +62,7 @@
 #include "zebra/zebra_pbr.h"
 #include "zebra/table_manager.h"
 #include "zebra/zapi_msg.h"
+#include "zebra/zebra_errors.h"
 
 /* Encoding helpers -------------------------------------------------------- */
 
@@ -117,6 +118,7 @@ static void zserv_encode_vrf(struct stream *s, struct zebra_vrf *zvrf)
 
 static int zserv_encode_nexthop(struct stream *s, struct nexthop *nexthop)
 {
+       stream_putl(s, nexthop->vrf_id);
        stream_putc(s, nexthop->type);
        switch (nexthop->type) {
        case NEXTHOP_TYPE_IPV4:
@@ -246,7 +248,7 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
  *      RTM_IFANNOUNCE or AF_NETLINK sockets is available), or when
  *      an interface is marked IFF_UP (i.e., an RTM_IFINFO message is
  *      received)
- *    - for the vty commands "ip address A.B.C.D/M [<secondary>|<label LINE>]"
+ *    - for the vty commands "ip address A.B.C.D/M [<label LINE>]"
  *      and "no bandwidth <1-10000000>", "ipv6 address X:X::X:X/M"
  *    - when an RTM_NEWADDR message is received from the kernel,
  *
@@ -267,7 +269,7 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
  *             |
  *         vty commands:
  *     "no ip address A.B.C.D/M [label LINE]"
- *     "no ip address A.B.C.D/M secondary"
+ *     "no ip address A.B.C.D/M"
  *     ["no ipv6 address X:X::X:X/M"]
  *
  */
@@ -739,6 +741,20 @@ int zsend_route_notify_owner(struct route_entry *re, const struct prefix *p,
                                      re->table, note));
 }
 
+/*
+ * Route-owner notification using info from dataplane update context.
+ */
+int zsend_route_notify_owner_ctx(const struct zebra_dplane_ctx *ctx,
+                                enum zapi_route_notify_owner note)
+{
+       return (route_notify_internal(dplane_ctx_get_dest(ctx),
+                                     dplane_ctx_get_type(ctx),
+                                     dplane_ctx_get_instance(ctx),
+                                     dplane_ctx_get_vrf(ctx),
+                                     dplane_ctx_get_table(ctx),
+                                     note));
+}
+
 void zsend_rule_notify_owner(struct zebra_pbr_rule *rule,
                             enum zapi_rule_notify_owner note)
 {
@@ -1022,6 +1038,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
        unsigned short l = 0;
        uint8_t flags = 0;
        uint16_t type = cmd2type[hdr->command];
+       bool exist;
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
@@ -1040,8 +1057,9 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                STREAM_GETC(s, p.prefixlen);
                l += 4;
                if (p.family == AF_INET) {
+                       client->v4_nh_watch_add_cnt++;
                        if (p.prefixlen > IPV4_MAX_BITLEN) {
-                               zlog_warn(
+                               zlog_debug(
                                        "%s: Specified prefix hdr->length %d is too large for a v4 address",
                                        __PRETTY_FUNCTION__, p.prefixlen);
                                return;
@@ -1049,8 +1067,9 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                        STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
                        l += IPV4_MAX_BYTELEN;
                } else if (p.family == AF_INET6) {
+                       client->v6_nh_watch_add_cnt++;
                        if (p.prefixlen > IPV6_MAX_BITLEN) {
-                               zlog_warn(
+                               zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v6 address",
                                        __PRETTY_FUNCTION__, p.prefixlen);
                                return;
@@ -1059,12 +1078,15 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                        l += IPV6_MAX_BYTELEN;
                } else {
                        flog_err(
-                               ZEBRA_ERR_UNKNOWN_FAMILY,
+                               EC_ZEBRA_UNKNOWN_FAMILY,
                                "rnh_register: Received unknown family type %d\n",
                                p.family);
                        return;
                }
-               rnh = zebra_add_rnh(&p, zvrf_id(zvrf), type);
+               rnh = zebra_add_rnh(&p, zvrf_id(zvrf), type, &exist);
+               if (!rnh)
+                       return;
+
                if (type == RNH_NEXTHOP_TYPE) {
                        if (flags
                            && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
@@ -1084,7 +1106,8 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
 
                zebra_add_rnh_client(rnh, client, type, zvrf_id(zvrf));
                /* Anything not AF_INET/INET6 has been filtered out above */
-               zebra_evaluate_rnh(zvrf_id(zvrf), p.family, 1, type, &p);
+               if (!exist)
+                       zebra_evaluate_rnh(zvrf, p.family, 1, type, &p);
        }
 
 stream_failure:
@@ -1119,8 +1142,9 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                STREAM_GETC(s, p.prefixlen);
                l += 4;
                if (p.family == AF_INET) {
+                       client->v4_nh_watch_rem_cnt++;
                        if (p.prefixlen > IPV4_MAX_BITLEN) {
-                               zlog_warn(
+                               zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v4 address",
                                        __PRETTY_FUNCTION__, p.prefixlen);
                                return;
@@ -1128,8 +1152,9 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                        STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
                        l += IPV4_MAX_BYTELEN;
                } else if (p.family == AF_INET6) {
+                       client->v6_nh_watch_rem_cnt++;
                        if (p.prefixlen > IPV6_MAX_BITLEN) {
-                               zlog_warn(
+                               zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v6 address",
                                        __PRETTY_FUNCTION__, p.prefixlen);
                                return;
@@ -1138,7 +1163,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                        l += IPV6_MAX_BYTELEN;
                } else {
                        flog_err(
-                               ZEBRA_ERR_UNKNOWN_FAMILY,
+                               EC_ZEBRA_UNKNOWN_FAMILY,
                                "rnh_register: Received unknown family type %d\n",
                                p.family);
                        return;
@@ -1162,6 +1187,7 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)
        unsigned short l = 0;
        struct prefix p;
        uint16_t flags;
+       uint32_t label = MPLS_INVALID_LABEL;
        uint32_t label_index = MPLS_INVALID_LABEL_INDEX;
 
        s = msg;
@@ -1175,7 +1201,7 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)
         */
        if (hdr->length < ZEBRA_MIN_FEC_LENGTH) {
                flog_err(
-                       ZEBRA_ERR_IRDP_LEN_MISMATCH,
+                       EC_ZEBRA_IRDP_LEN_MISMATCH,
                        "fec_register: Received a fec register of hdr->length %d, it is of insufficient size to properly decode",
                        hdr->length);
                return;
@@ -1187,7 +1213,7 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)
                STREAM_GETW(s, p.family);
                if (p.family != AF_INET && p.family != AF_INET6) {
                        flog_err(
-                               ZEBRA_ERR_UNKNOWN_FAMILY,
+                               EC_ZEBRA_UNKNOWN_FAMILY,
                                "fec_register: Received unknown family type %d\n",
                                p.family);
                        return;
@@ -1196,7 +1222,7 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)
                if ((p.family == AF_INET && p.prefixlen > IPV4_MAX_BITLEN)
                    || (p.family == AF_INET6
                        && p.prefixlen > IPV6_MAX_BITLEN)) {
-                       zlog_warn(
+                       zlog_debug(
                                "%s: Specified prefix hdr->length: %d is to long for %d",
                                __PRETTY_FUNCTION__, p.prefixlen, p.family);
                        return;
@@ -1204,12 +1230,15 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)
                l += 5;
                STREAM_GET(&p.u.prefix, s, PSIZE(p.prefixlen));
                l += PSIZE(p.prefixlen);
-               if (flags & ZEBRA_FEC_REGISTER_LABEL_INDEX) {
+               if (flags & ZEBRA_FEC_REGISTER_LABEL) {
+                       STREAM_GETL(s, label);
+                       l += 4;
+               } else if (flags & ZEBRA_FEC_REGISTER_LABEL_INDEX) {
                        STREAM_GETL(s, label_index);
                        l += 4;
-               } else
-                       label_index = MPLS_INVALID_LABEL_INDEX;
-               zebra_mpls_fec_register(zvrf, &p, label_index, client);
+               }
+
+               zebra_mpls_fec_register(zvrf, &p, label, label_index, client);
        }
 
 stream_failure:
@@ -1235,7 +1264,7 @@ static void zread_fec_unregister(ZAPI_HANDLER_ARGS)
         */
        if (hdr->length < ZEBRA_MIN_FEC_LENGTH) {
                flog_err(
-                       ZEBRA_ERR_IRDP_LEN_MISMATCH,
+                       EC_ZEBRA_IRDP_LEN_MISMATCH,
                        "fec_unregister: Received a fec unregister of hdr->length %d, it is of insufficient size to properly decode",
                        hdr->length);
                return;
@@ -1250,7 +1279,7 @@ static void zread_fec_unregister(ZAPI_HANDLER_ARGS)
                STREAM_GETW(s, p.family);
                if (p.family != AF_INET && p.family != AF_INET6) {
                        flog_err(
-                               ZEBRA_ERR_UNKNOWN_FAMILY,
+                               EC_ZEBRA_UNKNOWN_FAMILY,
                                "fec_unregister: Received unknown family type %d\n",
                                p.family);
                        return;
@@ -1259,7 +1288,7 @@ static void zread_fec_unregister(ZAPI_HANDLER_ARGS)
                if ((p.family == AF_INET && p.prefixlen > IPV4_MAX_BITLEN)
                    || (p.family == AF_INET6
                        && p.prefixlen > IPV6_MAX_BITLEN)) {
-                       zlog_warn(
+                       zlog_debug(
                                "%s: Received prefix hdr->length %d which is greater than %d can support",
                                __PRETTY_FUNCTION__, p.prefixlen, p.family);
                        return;
@@ -1312,7 +1341,8 @@ void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
                char buff[PREFIX2STR_BUFFER];
 
                prefix2str(p, buff, sizeof(buff));
-               zlog_warn(
+               flog_warn(
+                       EC_ZEBRA_MORE_NH_THAN_MULTIPATH,
                        "%s: Prefix %s has %d nexthops, but we can only use the first %d",
                        caller, buff, nexthop_num, multipath_num);
        }
@@ -1475,7 +1505,8 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
                        }
 
                        if (!nexthop) {
-                               zlog_warn(
+                               flog_warn(
+                                       EC_ZEBRA_NEXTHOP_CREATION_FAILED,
                                        "%s: Nexthops Specified: %d but we failed to properly create one",
                                        __PRETTY_FUNCTION__, api.nexthop_num);
                                nexthops_free(re->ng.nexthop);
@@ -1515,7 +1546,8 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
 
        afi = family2afi(api.prefix.family);
        if (afi != AFI_IP6 && CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {
-               zlog_warn("%s: Received SRC Prefix but afi is not v6",
+               flog_warn(EC_ZEBRA_RX_SRCDEST_WRONG_AFI,
+                         "%s: Received SRC Prefix but afi is not v6",
                          __PRETTY_FUNCTION__);
                nexthops_free(re->ng.nexthop);
                XFREE(MTYPE_RE, re);
@@ -1557,7 +1589,8 @@ static void zread_route_del(ZAPI_HANDLER_ARGS)
 
        afi = family2afi(api.prefix.family);
        if (afi != AFI_IP6 && CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {
-               zlog_warn("%s: Received a src prefix while afi is not v6",
+               flog_warn(EC_ZEBRA_RX_SRCDEST_WRONG_AFI,
+                         "%s: Received a src prefix while afi is not v6",
                          __PRETTY_FUNCTION__);
                return;
        }
@@ -1697,7 +1730,7 @@ static void zread_mpls_labels(ZAPI_HANDLER_ARGS)
                STREAM_GET(&prefix.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
                STREAM_GETC(s, prefix.prefixlen);
                if (prefix.prefixlen > IPV4_MAX_BITLEN) {
-                       zlog_warn(
+                       zlog_debug(
                                "%s: Specified prefix length %d is greater than a v4 address can support",
                                __PRETTY_FUNCTION__, prefix.prefixlen);
                        return;
@@ -1708,7 +1741,7 @@ static void zread_mpls_labels(ZAPI_HANDLER_ARGS)
                STREAM_GET(&prefix.u.prefix6, s, 16);
                STREAM_GETC(s, prefix.prefixlen);
                if (prefix.prefixlen > IPV6_MAX_BITLEN) {
-                       zlog_warn(
+                       zlog_debug(
                                "%s: Specified prefix length %d is greater than a v6 address can support",
                                __PRETTY_FUNCTION__, prefix.prefixlen);
                        return;
@@ -1716,8 +1749,8 @@ static void zread_mpls_labels(ZAPI_HANDLER_ARGS)
                STREAM_GET(&gate.ipv6, s, 16);
                break;
        default:
-               zlog_warn("%s: Specified AF %d is not supported for this call",
-                         __PRETTY_FUNCTION__, prefix.family);
+               zlog_debug("%s: Specified AF %d is not supported for this call",
+                          __PRETTY_FUNCTION__, prefix.family);
                return;
        }
        STREAM_GETL(s, ifindex);
@@ -1775,9 +1808,9 @@ static void zread_table_manager_connect(struct zserv *client,
 
        /* accept only dynamic routing protocols */
        if ((proto >= ZEBRA_ROUTE_MAX) || (proto <= ZEBRA_ROUTE_STATIC)) {
-               flog_err(ZEBRA_ERR_TM_WRONG_PROTO,
-                         "client %d has wrong protocol %s", client->sock,
-                         zebra_route_string(proto));
+               flog_err(EC_ZEBRA_TM_WRONG_PROTO,
+                        "client %d has wrong protocol %s", client->sock,
+                        zebra_route_string(proto));
                zsend_table_manager_connect_response(client, vrf_id, 1);
                return;
        }
@@ -1815,10 +1848,11 @@ static void zread_label_manager_connect(struct zserv *client,
 
        /* accept only dynamic routing protocols */
        if ((proto >= ZEBRA_ROUTE_MAX) || (proto <= ZEBRA_ROUTE_STATIC)) {
-               flog_err(ZEBRA_ERR_TM_WRONG_PROTO,
-                         "client %d has wrong protocol %s", client->sock,
-                         zebra_route_string(proto));
-               zsend_label_manager_connect_response(client, vrf_id, 1);
+               flog_err(EC_ZEBRA_TM_WRONG_PROTO,
+                        "client %d has wrong protocol %s", client->sock,
+                        zebra_route_string(proto));
+               if (client->is_synchronous)
+                       zsend_label_manager_connect_response(client, vrf_id, 1);
                return;
        }
        zlog_notice("client %d with vrf %u instance %u connected as %s",
@@ -1836,33 +1870,12 @@ static void zread_label_manager_connect(struct zserv *client,
                " Label Manager client connected: sock %d, proto %s, vrf %u instance %u",
                client->sock, zebra_route_string(proto), vrf_id, instance);
        /* send response back */
-       zsend_label_manager_connect_response(client, vrf_id, 0);
+       if (client->is_synchronous)
+               zsend_label_manager_connect_response(client, vrf_id, 0);
 
 stream_failure:
        return;
 }
-static int msg_client_id_mismatch(const char *op, struct zserv *client,
-                                 uint8_t proto, unsigned int instance)
-{
-       if (proto != client->proto) {
-               flog_err(ZEBRA_ERR_PROTO_OR_INSTANCE_MISMATCH,
-                         "%s: msg vs client proto mismatch, client=%u msg=%u",
-                         op, client->proto, proto);
-               /* TODO: fail when BGP sets proto and instance */
-               /* return 1; */
-       }
-
-       if (instance != client->instance) {
-               flog_err(
-                       ZEBRA_ERR_PROTO_OR_INSTANCE_MISMATCH,
-                       "%s: msg vs client instance mismatch, client=%u msg=%u",
-                       op, client->instance, instance);
-               /* TODO: fail when BGP sets proto and instance */
-               /* return 1; */
-       }
-
-       return 0;
-}
 
 static void zread_get_label_chunk(struct zserv *client, struct stream *msg,
                                  vrf_id_t vrf_id)
@@ -1883,21 +1896,16 @@ static void zread_get_label_chunk(struct zserv *client, struct stream *msg,
        STREAM_GETC(s, keep);
        STREAM_GETL(s, size);
 
-       /* detect client vs message (proto,instance) mismatch */
-       if (msg_client_id_mismatch("Get-label-chunk", client, proto, instance))
-               return;
-
-       lmc = assign_label_chunk(client->proto, client->instance, keep, size);
+       lmc = assign_label_chunk(proto, instance, keep, size);
        if (!lmc)
                flog_err(
-                       ZEBRA_ERR_LM_CANNOT_ASSIGN_CHUNK,
+                       EC_ZEBRA_LM_CANNOT_ASSIGN_CHUNK,
                        "Unable to assign Label Chunk of size %u to %s instance %u",
-                       size, zebra_route_string(client->proto),
-                       client->instance);
+                       size, zebra_route_string(proto), instance);
        else
                zlog_debug("Assigned Label Chunk %u - %u to %s instance %u",
                           lmc->start, lmc->end,
-                          zebra_route_string(client->proto), client->instance);
+                          zebra_route_string(proto), instance);
        /* send response back */
        zsend_assign_label_chunk_response(client, vrf_id, lmc);
 
@@ -1921,12 +1929,7 @@ static void zread_release_label_chunk(struct zserv *client, struct stream *msg)
        STREAM_GETL(s, start);
        STREAM_GETL(s, end);
 
-       /* detect client vs message (proto,instance) mismatch */
-       if (msg_client_id_mismatch("Release-label-chunk", client, proto,
-                                  instance))
-               return;
-
-       release_label_chunk(client->proto, client->instance, start, end);
+       release_label_chunk(proto, instance, start, end);
 
 stream_failure:
        return;
@@ -1934,8 +1937,8 @@ stream_failure:
 static void zread_label_manager_request(ZAPI_HANDLER_ARGS)
 {
        /* to avoid sending other messages like ZERBA_INTERFACE_UP */
-       if (hdr->command == ZEBRA_LABEL_MANAGER_CONNECT)
-               client->is_synchronous = 1;
+       client->is_synchronous = hdr->command ==
+                                ZEBRA_LABEL_MANAGER_CONNECT;
 
        /* external label manager */
        if (lm_is_external)
@@ -1943,16 +1946,10 @@ static void zread_label_manager_request(ZAPI_HANDLER_ARGS)
                                                  zvrf_id(zvrf));
        /* this is a label manager */
        else {
-               if (hdr->command == ZEBRA_LABEL_MANAGER_CONNECT)
+               if (hdr->command == ZEBRA_LABEL_MANAGER_CONNECT ||
+                   hdr->command == ZEBRA_LABEL_MANAGER_CONNECT_ASYNC)
                        zread_label_manager_connect(client, msg, zvrf_id(zvrf));
                else {
-                       /* Sanity: don't allow 'unidentified' requests */
-                       if (!client->proto) {
-                               flog_err(
-                                       ZEBRA_ERR_LM_ALIENS,
-                                       "Got label request from an unidentified client");
-                               return;
-                       }
                        if (hdr->command == ZEBRA_GET_LABEL_CHUNK)
                                zread_get_label_chunk(client, msg,
                                                      zvrf_id(zvrf));
@@ -1977,9 +1974,9 @@ static void zread_get_table_chunk(struct zserv *client, struct stream *msg,
 
        tmc = assign_table_chunk(client->proto, client->instance, size);
        if (!tmc)
-               flog_err(ZEBRA_ERR_TM_CANNOT_ASSIGN_CHUNK,
-                         "%s: Unable to assign Table Chunk of size %u",
-                         __func__, size);
+               flog_err(EC_ZEBRA_TM_CANNOT_ASSIGN_CHUNK,
+                        "%s: Unable to assign Table Chunk of size %u",
+                        __func__, size);
        else
                zlog_debug("Assigned Table Chunk %u - %u", tmc->start,
                           tmc->end);
@@ -2017,7 +2014,7 @@ static void zread_table_manager_request(ZAPI_HANDLER_ARGS)
                /* Sanity: don't allow 'unidentified' requests */
                if (!client->proto) {
                        flog_err(
-                               ZEBRA_ERR_TM_ALIENS,
+                               EC_ZEBRA_TM_ALIENS,
                                "Got table request from an unidentified client");
                        return;
                }
@@ -2071,7 +2068,8 @@ static void zread_pseudowire(ZAPI_HANDLER_ARGS)
        switch (hdr->command) {
        case ZEBRA_PW_ADD:
                if (pw) {
-                       zlog_warn("%s: pseudowire %s already exists [%s]",
+                       flog_warn(EC_ZEBRA_PSEUDOWIRE_EXISTS,
+                                 "%s: pseudowire %s already exists [%s]",
                                  __func__, ifname,
                                  zserv_command_string(hdr->command));
                        return;
@@ -2081,7 +2079,8 @@ static void zread_pseudowire(ZAPI_HANDLER_ARGS)
                break;
        case ZEBRA_PW_DELETE:
                if (!pw) {
-                       zlog_warn("%s: pseudowire %s not found [%s]", __func__,
+                       flog_warn(EC_ZEBRA_PSEUDOWIRE_NONEXISTENT,
+                                 "%s: pseudowire %s not found [%s]", __func__,
                                  ifname, zserv_command_string(hdr->command));
                        return;
                }
@@ -2091,7 +2090,8 @@ static void zread_pseudowire(ZAPI_HANDLER_ARGS)
        case ZEBRA_PW_SET:
        case ZEBRA_PW_UNSET:
                if (!pw) {
-                       zlog_warn("%s: pseudowire %s not found [%s]", __func__,
+                       flog_warn(EC_ZEBRA_PSEUDOWIRE_NONEXISTENT,
+                                 "%s: pseudowire %s not found [%s]", __func__,
                                  ifname, zserv_command_string(hdr->command));
                        return;
                }
@@ -2266,10 +2266,11 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS)
                if (zpr.rule.filter.fwmark)
                        zpr.rule.filter.filter_bm |= PBR_FILTER_FWMARK;
 
+               zpr.vrf_id = zvrf->vrf->vrf_id;
                if (hdr->command == ZEBRA_RULE_ADD)
-                       zebra_pbr_add_rule(zvrf->zns, &zpr);
+                       zebra_pbr_add_rule(&zpr);
                else
-                       zebra_pbr_del_rule(zvrf->zns, &zpr);
+                       zebra_pbr_del_rule(&zpr);
        }
 
 stream_failure:
@@ -2295,9 +2296,9 @@ static inline void zread_ipset(ZAPI_HANDLER_ARGS)
                STREAM_GET(&zpi.ipset_name, s, ZEBRA_IPSET_NAME_SIZE);
 
                if (hdr->command == ZEBRA_IPSET_CREATE)
-                       zebra_pbr_create_ipset(zvrf->zns, &zpi);
+                       zebra_pbr_create_ipset(&zpi);
                else
-                       zebra_pbr_destroy_ipset(zvrf->zns, &zpi);
+                       zebra_pbr_destroy_ipset(&zpi);
        }
 
 stream_failure:
@@ -2350,12 +2351,12 @@ static inline void zread_ipset_entry(ZAPI_HANDLER_ARGS)
                        zpi.filter_bm |= PBR_FILTER_PROTO;
 
                /* calculate backpointer */
-               zpi.backpointer = zebra_pbr_lookup_ipset_pername(
-                       zvrf->zns, ipset.ipset_name);
+               zpi.backpointer =
+                       zebra_pbr_lookup_ipset_pername(ipset.ipset_name);
                if (hdr->command == ZEBRA_IPSET_ENTRY_ADD)
-                       zebra_pbr_add_ipset_entry(zvrf->zns, &zpi);
+                       zebra_pbr_add_ipset_entry(&zpi);
                else
-                       zebra_pbr_del_ipset_entry(zvrf->zns, &zpi);
+                       zebra_pbr_del_ipset_entry(&zpi);
        }
 
 stream_failure:
@@ -2390,9 +2391,9 @@ static inline void zread_iptable(ZAPI_HANDLER_ARGS)
        zebra_pbr_iptable_update_interfacelist(s, &zpi);
 
        if (hdr->command == ZEBRA_IPTABLE_ADD)
-               zebra_pbr_add_iptable(zvrf->zns, &zpi);
+               zebra_pbr_add_iptable(&zpi);
        else
-               zebra_pbr_del_iptable(zvrf->zns, &zpi);
+               zebra_pbr_del_iptable(&zpi);
 stream_failure:
        return;
 }
@@ -2434,6 +2435,7 @@ void (*zserv_handlers[])(ZAPI_HANDLER_ARGS) = {
        [ZEBRA_MPLS_LABELS_DELETE] = zread_mpls_labels,
        [ZEBRA_IPMR_ROUTE_STATS] = zebra_ipmr_route_stats,
        [ZEBRA_LABEL_MANAGER_CONNECT] = zread_label_manager_request,
+       [ZEBRA_LABEL_MANAGER_CONNECT_ASYNC] = zread_label_manager_request,
        [ZEBRA_GET_LABEL_CHUNK] = zread_label_manager_request,
        [ZEBRA_RELEASE_LABEL_CHUNK] = zread_label_manager_request,
        [ZEBRA_FEC_REGISTER] = zread_fec_register,
@@ -2445,6 +2447,7 @@ void (*zserv_handlers[])(ZAPI_HANDLER_ARGS) = {
        [ZEBRA_REMOTE_VTEP_DEL] = zebra_vxlan_remote_vtep_del,
        [ZEBRA_REMOTE_MACIP_ADD] = zebra_vxlan_remote_macip_add,
        [ZEBRA_REMOTE_MACIP_DEL] = zebra_vxlan_remote_macip_del,
+       [ZEBRA_DUPLICATE_ADDR_DETECTION] = zebra_vxlan_dup_addr_detection,
        [ZEBRA_INTERFACE_SET_MASTER] = zread_interface_set_master,
        [ZEBRA_PW_ADD] = zread_pseudowire,
        [ZEBRA_PW_DELETE] = zread_pseudowire,
@@ -2461,6 +2464,7 @@ void (*zserv_handlers[])(ZAPI_HANDLER_ARGS) = {
        [ZEBRA_IPSET_ENTRY_DELETE] = zread_ipset_entry,
        [ZEBRA_IPTABLE_ADD] = zread_iptable,
        [ZEBRA_IPTABLE_DELETE] = zread_iptable,
+       [ZEBRA_VXLAN_FLOOD_CONTROL] = zebra_vxlan_flood_control,
 };
 
 #if defined(HANDLE_ZAPI_FUZZING)
@@ -2503,8 +2507,8 @@ void zserv_handle_commands(struct zserv *client, struct stream *msg)
        zvrf = zebra_vrf_lookup_by_id(hdr.vrf_id);
        if (!zvrf) {
                if (IS_ZEBRA_DEBUG_PACKET && IS_ZEBRA_DEBUG_RECV)
-                       zlog_warn("ZAPI message specifies unknown VRF: %d",
-                                 hdr.vrf_id);
+                       zlog_debug("ZAPI message specifies unknown VRF: %d",
+                                  hdr.vrf_id);
                return;
        }