[ovs-dev] [PATCH] datapath: Check if gre kernel module is loaded

Greg Rose gvrose8192 at gmail.com
Wed Jun 6 22:23:28 UTC 2018


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 at gmail.com>
---
 datapath/vport.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/datapath/vport.c b/datapath/vport.c
index 56096ef..02f6b56 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -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.
-- 
1.8.3.1



More information about the dev mailing list