]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix flowspec ipset operations
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 28 Oct 2021 11:42:57 +0000 (13:42 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 3 Nov 2021 16:17:08 +0000 (17:17 +0100)
When injecting an ipset entry into the zebra dataplane context, the
ipset name is stored in a separate structure. This will permit the
flowspec plugin to be able to know which ipset has to be appended with
relevant ipset entry.
The problem was that the zebra dataplane objects related to ipset entries
is made up of an union between the ipset structure and the ipset info
structure. This was implying that the two structures were on the same
memory zone, and when extracting the data stored, the data were incomplete.

Fix this by replacing the union structure by a defined struct.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/zebra_dplane.c

index 9e9844390d0fae039ae1d688565035cbde675d60..f5a6328cc919dae9765d3b1f4ad4346390302532 100644 (file)
@@ -341,7 +341,7 @@ struct zebra_dplane_ctx {
                struct dplane_rule_info rule;
                struct zebra_pbr_iptable iptable;
                struct zebra_pbr_ipset ipset;
-               union {
+               struct {
                        struct zebra_pbr_ipset_entry entry;
                        struct zebra_pbr_ipset_info info;
                } ipset_entry;