]> git.itanic.dy.fi Git - linux-stable/commitdiff
openvswitch: correct encoding of set tunnel action attributes
authorSimon Horman <simon.horman@netronome.com>
Fri, 18 Dec 2015 10:43:15 +0000 (19:43 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Jan 2016 19:25:49 +0000 (11:25 -0800)
[ Upstream commit e905eabc90a5b787d8708df164543ee295bea5f2 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/openvswitch/flow_netlink.c

index 38536c137c54d0d4ebcebcce613fefdb89799b5a..45635118cc862070c8570e725786d9c7a622b4a0 100644 (file)
@@ -2382,7 +2382,9 @@ 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 =  ipv4_tun_to_nlattr(skb, &tun_info->key,
+                                         ip_tunnel_info_opts(tun_info),
+                                         tun_info->options_len);
                if (err)
                        return err;
                nla_nest_end(skb, start);