netlink: allow be16 and be32 types in all uint policy checks
[platform/kernel/linux-starfive.git] / lib / nlattr.c
index 489e15b..7a2b6c3 100644 (file)
@@ -355,6 +355,12 @@ static int nla_validate_mask(const struct nla_policy *pt,
        case NLA_U64:
                value = nla_get_u64(nla);
                break;
+       case NLA_BE16:
+               value = ntohs(nla_get_be16(nla));
+               break;
+       case NLA_BE32:
+               value = ntohl(nla_get_be32(nla));
+               break;
        default:
                return -EINVAL;
        }