diff options
author | Jiri Benc <jbenc@redhat.com> | 2015-10-05 07:09:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-07 07:17:59 -0400 |
commit | 00a93babd06aaad31d23384cda576ede0f586a8c (patch) | |
tree | 2fd12c2f928eae294ae0892e99562ac1f2d9997e /net/openvswitch/flow.c | |
parent | 4917a1548ff41e53d863d6845b4da1884e4282b4 (diff) |
openvswitch: add tunnel protocol to sw_flow_key
Store tunnel protocol (AF_INET or AF_INET6) in sw_flow_key. This field now
also acts as an indicator whether the flow contains tunnel data (this was
previously indicated by tun_key.u.ipv4.dst being set but with IPv6 addresses
in an union with IPv4 ones this won't work anymore).
The new field was added to a hole in sw_flow_key.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r-- | net/openvswitch/flow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index c8db44ab2ee7..0ea128eeeab2 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -698,8 +698,7 @@ int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info, | |||
698 | { | 698 | { |
699 | /* Extract metadata from packet. */ | 699 | /* Extract metadata from packet. */ |
700 | if (tun_info) { | 700 | if (tun_info) { |
701 | if (ip_tunnel_info_af(tun_info) != AF_INET) | 701 | key->tun_proto = ip_tunnel_info_af(tun_info); |
702 | return -EINVAL; | ||
703 | memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key)); | 702 | memcpy(&key->tun_key, &tun_info->key, sizeof(key->tun_key)); |
704 | 703 | ||
705 | if (tun_info->options_len) { | 704 | if (tun_info->options_len) { |
@@ -714,6 +713,7 @@ int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info, | |||
714 | key->tun_opts_len = 0; | 713 | key->tun_opts_len = 0; |
715 | } | 714 | } |
716 | } else { | 715 | } else { |
716 | key->tun_proto = 0; | ||
717 | key->tun_opts_len = 0; | 717 | key->tun_opts_len = 0; |
718 | memset(&key->tun_key, 0, sizeof(key->tun_key)); | 718 | memset(&key->tun_key, 0, sizeof(key->tun_key)); |
719 | } | 719 | } |