]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: rework pbr ipset entry
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 27 Mar 2018 09:27:10 +0000 (11:27 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 May 2018 13:49:38 +0000 (15:49 +0200)
Add ns_id into zebra_pbr ipset
This is important so that each ipset entry knows on which NETNS the
ipset entry must be inkected

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/zapi_msg.c
zebra/zebra_ns.c
zebra/zebra_pbr.h

index 9a18cc22f0c5500c090b7ef1c2cb56515129a187..ae6ccf9f5a27e4f2cff4a763db8f2911d1430b89 100644 (file)
@@ -2847,6 +2847,7 @@ static inline void zread_ipset(ZAPI_HANDLER_ARGS)
                memset(&zpi, 0, sizeof(zpi));
 
                zpi.sock = client->sock;
+               zpi.vrf_id = zvrf->vrf->vrf_id;
                STREAM_GETL(s, zpi.unique);
                STREAM_GETL(s, zpi.type);
                STREAM_GET(&zpi.ipset_name, s, ZEBRA_IPSET_NAME_SIZE);
@@ -2914,6 +2915,7 @@ static inline void zread_iptable(ZAPI_HANDLER_ARGS)
        memset(&zpi, 0, sizeof(zpi));
 
        zpi.sock = client->sock;
+       zpi.vrf_id = zvrf->vrf->vrf_id;
        STREAM_GETL(s, zpi.unique);
        STREAM_GETL(s, zpi.type);
        STREAM_GETL(s, zpi.filter_bm);
index 5c62e366a63293ab96c961c6d3f01f79ebbb4993..4526a14870f00ed457ccc6d0ef45f29c31de6695 100644 (file)
@@ -262,10 +262,10 @@ int zebra_ns_disable(ns_id_t ns_id, void **info)
 
        hash_clean(zns->rules_hash, zebra_pbr_rules_free);
        hash_free(zns->rules_hash);
-       hash_clean(zns->ipset_hash, zebra_pbr_ipset_free);
-       hash_free(zns->ipset_hash);
        hash_clean(zns->ipset_entry_hash,
                   zebra_pbr_ipset_entry_free),
+       hash_clean(zns->ipset_hash, zebra_pbr_ipset_free);
+       hash_free(zns->ipset_hash);
        hash_free(zns->ipset_entry_hash);
        hash_clean(zns->iptable_hash,
                   zebra_pbr_iptable_free);
index 6b5cd1e8d12ec82d3f5c3d280fb85224dfb8b628..8cb83fe7cce9ca255c0e3fc318c36873b34cec87 100644 (file)
@@ -61,6 +61,8 @@ struct zebra_pbr_ipset {
         */
        int sock;
 
+       vrf_id_t vrf_id;
+
        uint32_t unique;
 
        /* type is encoded as uint32_t
@@ -104,6 +106,8 @@ struct zebra_pbr_iptable {
         */
        int sock;
 
+       vrf_id_t vrf_id;
+
        uint32_t unique;
 
        /* include ipset type