diff mbox

[ovs-dev,net] openvswitch: correct encoding of set tunnel action attributes

Message ID 1450435395-23775-1-git-send-email-simon.horman@netronome.com
State Not Applicable
Headers show

Commit Message

Simon Horman Dec. 18, 2015, 10:43 a.m. UTC
In a set action tunnel attributes should be encoded in a
nested action.

I noticed this because ovs-dpctl was reporting an error
when dumping flows due to the incorrect encoding of tunnel attributes
in a set action.

Fixes: fc4099f17240 ("openvswitch: Fix egress tunnel info.")
Signed-off-by: Simon Horman <simon.horman@netronome.com>

---
* Lightly tested using ovs-dpctl dump-flows
---
 net/openvswitch/flow_netlink.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

David Miller Dec. 18, 2015, 9:36 p.m. UTC | #1
From: Simon Horman <simon.horman@netronome.com>
Date: Fri, 18 Dec 2015 19:43:15 +0900

> In a set action tunnel attributes should be encoded in a
> nested action.
> 
> I noticed this because ovs-dpctl was reporting an error
> when dumping flows due to the incorrect encoding of tunnel attributes
> in a set action.
> 
> Fixes: fc4099f17240 ("openvswitch: Fix egress tunnel info.")
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Applied and queued up for -stable, thanks Simon.
diff mbox

Patch

diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 907d6fd28ede..d1bd4a45ca2d 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2434,7 +2434,10 @@  static int set_action_to_attr(const struct nlattr *a, struct sk_buff *skb)
 		if (!start)
 			return -EMSGSIZE;
 
-		err = ovs_nla_put_tunnel_info(skb, tun_info);
+		err =  ip_tun_to_nlattr(skb, &tun_info->key,
+					ip_tunnel_info_opts(tun_info),
+					tun_info->options_len,
+					ip_tunnel_info_af(tun_info));
 		if (err)
 			return err;
 		nla_nest_end(skb, start);