aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow.c
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2015-08-30 21:09:38 -0400
committerDavid S. Miller <davem@davemloft.net>2015-08-31 15:28:56 -0400
commit4c22279848c531fc7f555d463daf3d0df963bd41 (patch)
tree38315c4715393860962cc00a19f47fa1554b6add /net/openvswitch/flow.c
parentd1bfc62591a0a5144dc380976e737fbbb4f40f4f (diff)
ip-tunnel: Use API to access tunnel metadata options.
Currently tun-info options pointer is used in few cases to pass options around. But tunnel options can be accessed using ip_tunnel_info_opts() API without using the pointer. Following patch removes the redundant pointer and consistently make use of API. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Reviewed-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r--net/openvswitch/flow.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index bed8d09230cd..c8db44ab2ee7 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -702,12 +702,13 @@ int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info,
702 return -EINVAL; 702 return -EINVAL;
703 memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key)); 703 memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key));
704 704
705 if (tun_info->options) { 705 if (tun_info->options_len) {
706 BUILD_BUG_ON((1 << (sizeof(tun_info->options_len) * 706 BUILD_BUG_ON((1 << (sizeof(tun_info->options_len) *
707 8)) - 1 707 8)) - 1
708 > sizeof(key->tun_opts)); 708 > sizeof(key->tun_opts));
709 memcpy(TUN_METADATA_OPTS(key, tun_info->options_len), 709
710 tun_info->options, tun_info->options_len); 710 ip_tunnel_info_opts_get(TUN_METADATA_OPTS(key, tun_info->options_len),
711 tun_info);
711 key->tun_opts_len = tun_info->options_len; 712 key->tun_opts_len = tun_info->options_len;
712 } else { 713 } else {
713 key->tun_opts_len = 0; 714 key->tun_opts_len = 0;