summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-09-07 14:33:44 +0300
committerDavid S. Miller <davem@davemloft.net>2022-09-07 14:33:44 +0300
commitda7d8e65b3fcebce0a2f606669cabce64fca0475 (patch)
tree98c5caf15be26c3223112d743687ef49bdd37e06 /include
parent98ba81081b429d147c0230f59a999aa80d0b9d33 (diff)
parente7af210e6dd0de633d3f4850383310cf57473bc8 (diff)
downloadlinux-da7d8e65b3fcebce0a2f606669cabce64fca0475.tar.xz
Merge branch 'netlink-be-policy'
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/netlink.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index e658d18afa67..4418b1981e31 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -325,6 +325,7 @@ struct nla_policy {
struct netlink_range_validation_signed *range_signed;
struct {
s16 min, max;
+ u8 network_byte_order:1;
};
int (*validate)(const struct nlattr *attr,
struct netlink_ext_ack *extack);
@@ -418,6 +419,14 @@ struct nla_policy {
.type = NLA_ENSURE_INT_OR_BINARY_TYPE(tp), \
.validation_type = NLA_VALIDATE_MAX, \
.max = _max, \
+ .network_byte_order = 0, \
+}
+
+#define NLA_POLICY_MAX_BE(tp, _max) { \
+ .type = NLA_ENSURE_UINT_TYPE(tp), \
+ .validation_type = NLA_VALIDATE_MAX, \
+ .max = _max, \
+ .network_byte_order = 1, \
}
#define NLA_POLICY_MASK(tp, _mask) { \