diff mbox

[net] openvswitch: Reset key metadata for packet execution.

Message ID 1423604116-1438-1-git-send-email-pshelar@nicira.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Pravin B Shelar Feb. 10, 2015, 9:35 p.m. UTC
Userspace packet execute command pass down flow key for given
packet. But userspace can skip some parameter with zero value.
Therefore kernel needs to initialize key metadata to zero.

Fixes: 0714812134 ("openvswitch: Eliminate memset() from flow_extract.")
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 net/openvswitch/flow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

David Miller Feb. 11, 2015, 10:40 p.m. UTC | #1
From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 10 Feb 2015 13:35:16 -0800

> Userspace packet execute command pass down flow key for given
> packet. But userspace can skip some parameter with zero value.
> Therefore kernel needs to initialize key metadata to zero.
> 
> Fixes: 0714812134 ("openvswitch: Eliminate memset() from flow_extract.")
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>

Applied, but...

> + 	memset(key, 0, OVS_SW_FLOW_KEY_METADATA_SIZE);

There's a space before the TAB in that indentation, and git even
warns about this when applying patches.

I fixed it up, but this is one of the basic things you should be
dealing with before submitting your changes.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pravin B Shelar Feb. 11, 2015, 10:57 p.m. UTC | #2
On Wed, Feb 11, 2015 at 2:40 PM, David Miller <davem@davemloft.net> wrote:
> From: Pravin B Shelar <pshelar@nicira.com>
> Date: Tue, 10 Feb 2015 13:35:16 -0800
>
>> Userspace packet execute command pass down flow key for given
>> packet. But userspace can skip some parameter with zero value.
>> Therefore kernel needs to initialize key metadata to zero.
>>
>> Fixes: 0714812134 ("openvswitch: Eliminate memset() from flow_extract.")
>> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
>
> Applied, but...
>
>> +     memset(key, 0, OVS_SW_FLOW_KEY_METADATA_SIZE);
>
> There's a space before the TAB in that indentation, and git even
> warns about this when applying patches.
>
> I fixed it up, but this is one of the basic things you should be
> dealing with before submitting your changes.
>

Thanks for fixing the patch.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index da2fae0..5e41bf2 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -717,6 +717,8 @@  int ovs_flow_key_extract_userspace(const struct nlattr *attr,
 {
 	int err;
 
+ 	memset(key, 0, OVS_SW_FLOW_KEY_METADATA_SIZE);
+
 	/* Extract metadata from netlink attributes. */
 	err = ovs_nla_get_flow_metadata(attr, key, log);
 	if (err)