]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fou: Fix IPv6 netlink policy
authorKristian Evensen <kristian.evensen@gmail.com>
Thu, 23 Jan 2020 12:20:18 +0000 (13:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jan 2020 13:32:52 +0000 (14:32 +0100)
When submitting v2 of "fou: Support binding FoU socket" (b7d45d61a924),
I accidentally sent the wrong version of the patch and one fix was
missing. In the initial version of the patch, as well as the version 2
that I submitted, I incorrectly used ".type" for the two V6-attributes.
The correct is to use ".len".

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: b7d45d61a924 ("fou: Support binding FoU socket")
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fou.c

index 30fa771d382a0a723c8d9b9610950b681e17e362..dcc79ff54b41640fa048810f164655e7b4d5bc65 100644 (file)
@@ -662,8 +662,8 @@ static const struct nla_policy fou_nl_policy[FOU_ATTR_MAX + 1] = {
        [FOU_ATTR_REMCSUM_NOPARTIAL]    = { .type = NLA_FLAG, },
        [FOU_ATTR_LOCAL_V4]             = { .type = NLA_U32, },
        [FOU_ATTR_PEER_V4]              = { .type = NLA_U32, },
-       [FOU_ATTR_LOCAL_V6]             = { .type = sizeof(struct in6_addr), },
-       [FOU_ATTR_PEER_V6]              = { .type = sizeof(struct in6_addr), },
+       [FOU_ATTR_LOCAL_V6]             = { .len = sizeof(struct in6_addr), },
+       [FOU_ATTR_PEER_V6]              = { .len = sizeof(struct in6_addr), },
        [FOU_ATTR_PEER_PORT]            = { .type = NLA_U16, },
        [FOU_ATTR_IFINDEX]              = { .type = NLA_S32, },
 };