lwtunnel: change to use nla_put_u8 for LWTUNNEL_IP_OPT_ERSPAN_VER
authorXin Long <lucien.xin@gmail.com>
Mon, 18 Nov 2019 10:10:12 +0000 (18:10 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Nov 2019 01:19:56 +0000 (17:19 -0800)
LWTUNNEL_IP_OPT_ERSPAN_VER is u8 type, and nla_put_u8 should have
been used instead of nla_put_u32(). This is a copy-paste error.

Fixes: b0a21810bd5e ("lwtunnel: add options setting and dumping for erspan")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel_core.c

index c724fb30d0486f6c1e842ef05367e96a8421e76d..db942b4a2e4a2008c85bc7848d92bfcea5254fd7 100644 (file)
@@ -526,7 +526,7 @@ static int ip_tun_fill_encap_opts_erspan(struct sk_buff *skb,
                return -ENOMEM;
 
        md = ip_tunnel_info_opts(tun_info);
-       if (nla_put_u32(skb, LWTUNNEL_IP_OPT_ERSPAN_VER, md->version))
+       if (nla_put_u8(skb, LWTUNNEL_IP_OPT_ERSPAN_VER, md->version))
                goto err;
 
        if (md->version == 1 &&