]> granicus.if.org Git - libnl/commitdiff
ipvti: Fix wrong array size initialization
authorThomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Fri, 8 Jun 2018 03:45:42 +0000 (15:45 +1200)
committerThomas Haller <thaller@redhat.com>
Mon, 25 Jun 2018 13:10:00 +0000 (15:10 +0200)
IPv4 VTI tunnels use the VTI defines.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Fixes: 8f6301426a00d992d00238c7ddd666e96aa63e28
lib/route/link/ipvti.c

index 0fa80ea0b228a72560ea84a80c0042f005d06816..851d566597d50aca99d000ba163dae313a8cdfb7 100644 (file)
@@ -48,7 +48,7 @@ struct ipvti_info
        uint32_t   ipvti_mask;
 };
 
-static struct nla_policy ipvti_policy[IFLA_GRE_MAX + 1] = {
+static struct nla_policy ipvti_policy[IFLA_VTI_MAX + 1] = {
        [IFLA_VTI_LINK]     = { .type = NLA_U32 },
        [IFLA_VTI_IKEY]     = { .type = NLA_U32 },
        [IFLA_VTI_OKEY]     = { .type = NLA_U32 },
@@ -76,13 +76,13 @@ static int ipvti_alloc(struct rtnl_link *link)
 static int ipvti_parse(struct rtnl_link *link, struct nlattr *data,
                       struct nlattr *xstats)
 {
-       struct nlattr *tb[IFLA_IPTUN_MAX + 1];
+       struct nlattr *tb[IFLA_VTI_MAX + 1];
        struct ipvti_info *ipvti;
        int err;
 
        NL_DBG(3, "Parsing IPVTI link info\n");
 
-       err = nla_parse_nested(tb, IFLA_GRE_MAX, data, ipvti_policy);
+       err = nla_parse_nested(tb, IFLA_VTI_MAX, data, ipvti_policy);
        if (err < 0)
                goto errout;