add blobmsg validation function

This commit is contained in:
Felix Fietkau 2011-01-23 19:55:41 +01:00
parent 63cea8dcb7
commit 71f0be5e11
3 changed files with 23 additions and 8 deletions

2
blob.h
View file

@ -141,7 +141,7 @@ blob_id(struct blob_attr *attr)
* blob_len: returns the length of the attribute's payload
*/
static inline unsigned int
blob_len(struct blob_attr *attr)
blob_len(const struct blob_attr *attr)
{
return (be32_to_cpu(attr->id_len) & BLOB_ATTR_LEN_MASK) - sizeof(struct blob_attr);
}