aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/flow_netlink.c')
-rw-r--r--net/openvswitch/flow_netlink.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index d757848da89c..630b320fbf3e 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -836,7 +836,7 @@ int ovs_nla_get_match(struct sw_flow_match *match,
836 836
837/** 837/**
838 * ovs_nla_get_flow_metadata - parses Netlink attributes into a flow key. 838 * ovs_nla_get_flow_metadata - parses Netlink attributes into a flow key.
839 * @flow: Receives extracted in_port, priority, tun_key and skb_mark. 839 * @key: Receives extracted in_port, priority, tun_key and skb_mark.
840 * @attr: Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink attribute 840 * @attr: Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink attribute
841 * sequence. 841 * sequence.
842 * 842 *
@@ -846,32 +846,24 @@ int ovs_nla_get_match(struct sw_flow_match *match,
846 * extracted from the packet itself. 846 * extracted from the packet itself.
847 */ 847 */
848 848
849int ovs_nla_get_flow_metadata(struct sw_flow *flow, 849int ovs_nla_get_flow_metadata(const struct nlattr *attr,
850 const struct nlattr *attr) 850 struct sw_flow_key *key)
851{ 851{
852 struct ovs_key_ipv4_tunnel *tun_key = &flow->key.tun_key;
853 const struct nlattr *a[OVS_KEY_ATTR_MAX + 1]; 852 const struct nlattr *a[OVS_KEY_ATTR_MAX + 1];
853 struct sw_flow_match match;
854 u64 attrs = 0; 854 u64 attrs = 0;
855 int err; 855 int err;
856 struct sw_flow_match match;
857
858 flow->key.phy.in_port = DP_MAX_PORTS;
859 flow->key.phy.priority = 0;
860 flow->key.phy.skb_mark = 0;
861 memset(tun_key, 0, sizeof(flow->key.tun_key));
862 856
863 err = parse_flow_nlattrs(attr, a, &attrs); 857 err = parse_flow_nlattrs(attr, a, &attrs);
864 if (err) 858 if (err)
865 return -EINVAL; 859 return -EINVAL;
866 860
867 memset(&match, 0, sizeof(match)); 861 memset(&match, 0, sizeof(match));
868 match.key = &flow->key; 862 match.key = key;
869 863
870 err = metadata_from_nlattrs(&match, &attrs, a, false); 864 key->phy.in_port = DP_MAX_PORTS;
871 if (err)
872 return err;
873 865
874 return 0; 866 return metadata_from_nlattrs(&match, &attrs, a, false);
875} 867}
876 868
877int ovs_nla_put_flow(const struct sw_flow_key *swkey, 869int ovs_nla_put_flow(const struct sw_flow_key *swkey,