Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\nlattr.c Create Date:2022-07-28 07:16:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:nla_validate_int_range

Proto:static int nla_validate_int_range(const struct nla_policy *pt, const struct nlattr *nla, struct netlink_ext_ack *extack)

Type:int

Parameter:

TypeParameterName
const struct nla_policy *pt
const struct nlattr *nla
struct netlink_ext_ack *extack
106  validate_min = validation_type == NLA_VALIDATE_RANGE || validation_type == NLA_VALIDATE_MIN
108  validate_max = validation_type == NLA_VALIDATE_RANGE || validation_type == NLA_VALIDATE_MAX
112  Case specific validation (e.g. range, function call), see == NLA_U8
113  value = la_get_u8 - return payload of u8 attribute*@nla: u8 netlink attribute
114  Break
115  Case specific validation (e.g. range, function call), see == NLA_U16
116  value = la_get_u16 - return payload of u16 attribute*@nla: u16 netlink attribute
117  Break
118  Case specific validation (e.g. range, function call), see == NLA_U32
119  value = la_get_u32 - return payload of u32 attribute*@nla: u32 netlink attribute
120  Break
121  Case specific validation (e.g. range, function call), see == NLA_S8
122  value = la_get_s8 - return payload of s8 attribute*@nla: s8 netlink attribute
123  Break
124  Case specific validation (e.g. range, function call), see == NLA_S16
125  value = la_get_s16 - return payload of s16 attribute*@nla: s16 netlink attribute
126  Break
127  Case specific validation (e.g. range, function call), see == NLA_S32
128  value = la_get_s32 - return payload of s32 attribute*@nla: s32 netlink attribute
129  Break
130  Case specific validation (e.g. range, function call), see == NLA_S64
131  value = la_get_s64 - return payload of s64 attribute*@nla: s64 netlink attribute
132  Break
133  Case specific validation (e.g. range, function call), see == NLA_U64
137  NL_SET_ERR_MSG_ATTR(extack, nla, "integer out of range")
139  Return -ERANGE
141  Return 0
142  Default
143  WARN_ON(1)
144  Return -EINVAL
147  If validate_min && value < min || validate_max && value > max Then
149  NL_SET_ERR_MSG_ATTR(extack, nla, "integer out of range")
151  Return -ERANGE
154  Return 0
Caller
NameDescribe
validate_nla