]> git.proxmox.com Git - mirror_ovs.git/commit - datapath/datapath.c
datapath: genetlink: optionally validate strictly/dumps
authorYi-Hung Wei <yihung.wei@gmail.com>
Tue, 15 Oct 2019 17:27:48 +0000 (10:27 -0700)
committerBen Pfaff <blp@ovn.org>
Fri, 18 Oct 2019 17:55:47 +0000 (10:55 -0700)
commitf1e9590e81908f4d4c67d0f2a405def6bf520c98
treeea296fa1190a44ba2c071b0dae0a0933a3995748
parent09c33996160399bd7c5e6029f5f18340c7f59a71
datapath: genetlink: optionally validate strictly/dumps

This patch backports the following upstream commit within the
openvswitch kernel module with some checks so that it also works
in the older kernel.

Upstream commit:
commit ef6243acb4782df587a4d7d6c310fa5b5d82684b
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Fri Apr 26 14:07:31 2019 +0200

    genetlink: optionally validate strictly/dumps

    Add options to strictly validate messages and dump messages,
    sometimes perhaps validating dump messages non-strictly may
    be required, so add an option for that as well.

    Since none of this can really be applied to existing commands,
    set the options everwhere using the following spatch:

        @@
        identifier ops;
        expression X;
        @@
        struct genl_ops ops[] = {
        ...,
         {
                .cmd = X,
        +       .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
                ...
         },
        ...
        };

    For new commands one should just not copy the .validate 'opt-out'
    flags and thus get strict validation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
acinclude.m4
datapath/conntrack.c
datapath/datapath.c
datapath/meter.c