/* Check if the attribute header and payload can be accessed safely.  */
int nla_ok(const struct nlattr *nla, int remaining)
/* Check if the attribute header and payload can be accessed safely.  */
int nla_ok(const struct nlattr *nla, int remaining)
{
	return remaining >= sizeof(*nla) &&
	       nla->nla_len >= sizeof(*nla) &&
	       nla->nla_len <= remaining;
}