summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2020-10-08 15:53:43 +0200
committerIlya Maximets <i.maximets@ovn.org>2020-10-08 18:04:59 +0200
commit61e157ca69ae226a3b73d32356afa0f2b74c4e4c (patch)
tree90afb262874498a29042a2328bdb85635c6a9bab
parentf00c47b8f33d28fbff5347c1c4e318ddcbdaf10a (diff)
downloadopenvswitch-61e157ca69ae226a3b73d32356afa0f2b74c4e4c.tar.gz
datapath: Fix exposing OVS_TUNNEL_KEY_ATTR_GTPU_OPTS to kernel module.
Kernel module doesn't know about GTPU and it should return correct out-of-range error in case this tunnel attribute passed there for any reason. Current out-of-tree module will pass the range check and will try to access ovs_tunnel_key_lens[] array by index OVS_TUNNEL_KEY_ATTR_GTPU_OPTS. Even though it might not produce issues in current code, this is not a good thing to do since ovs_tunnel_key_lens[] array is not explicitly initialized for OVS_TUNNEL_KEY_ATTR_GTPU_OPTS and we will likely have misleading error about incorrect attribute length in the end. Fixes: 3c6d05a02e0f ("userspace: Add GTP-U support.") Acked-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--datapath/linux/compat/include/linux/openvswitch.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h
index cc41bbea4..2d884312f 100644
--- a/datapath/linux/compat/include/linux/openvswitch.h
+++ b/datapath/linux/compat/include/linux/openvswitch.h
@@ -405,7 +405,10 @@ enum ovs_tunnel_key_attr {
OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */
OVS_TUNNEL_KEY_ATTR_PAD,
OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* struct erspan_metadata */
+#ifndef __KERNEL__
+ /* Only used within userspace data path. */
OVS_TUNNEL_KEY_ATTR_GTPU_OPTS, /* struct gtpu_metadata */
+#endif
__OVS_TUNNEL_KEY_ATTR_MAX
};