]> git.proxmox.com Git - ovs.git/commitdiff
datapath: Check if gre kernel module is loaded
authorGreg Rose <gvrose8192@gmail.com>
Wed, 6 Jun 2018 22:23:28 +0000 (15:23 -0700)
committerBen Pfaff <blp@ovn.org>
Thu, 7 Jun 2018 16:49:17 +0000 (09:49 -0700)
Before attempting to add a gre tunnel to OVS via the vport gre
kernel interface make sure that the openvswitch kernel module has
been able to grab the gre protocol entry point.  If OVS does not
own the gre protocol then report address family not supported.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
datapath/vport.c

index 56096efc0f73b32325ad7720a089e3ad0bc83b20..02f6b56d3243de818b16f41fba7f903cc02b1df7 100644 (file)
@@ -289,6 +289,10 @@ struct vport *ovs_vport_add(const struct vport_parms *parms)
                return vport;
        }
 
+       if (parms->type == OVS_VPORT_TYPE_GRE && !compat_gre_loaded) {
+               pr_warn("GRE protocol already loaded!\n");
+               return ERR_PTR(-EAFNOSUPPORT);
+       }
        /* Unlock to attempt module load and return -EAGAIN if load
         * was successful as we need to restart the port addition
         * workflow.