@@ -225,13 +225,15 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
225
225
u32 pid , unsigned int group , int report ,
226
226
gfp_t flags );
227
227
228
- extern int nla_validate (struct nlattr * head , int len , int maxtype ,
228
+ extern int nla_validate (const struct nlattr * head ,
229
+ int len , int maxtype ,
229
230
const struct nla_policy * policy );
230
- extern int nla_parse (struct nlattr * tb [] , int maxtype ,
231
- struct nlattr * head , int len ,
231
+ extern int nla_parse (struct nlattr * * tb , int maxtype ,
232
+ const struct nlattr * head , int len ,
232
233
const struct nla_policy * policy );
233
234
extern int nla_policy_len (const struct nla_policy * , int );
234
- extern struct nlattr * nla_find (struct nlattr * head , int len , int attrtype );
235
+ extern struct nlattr * nla_find (const struct nlattr * head ,
236
+ int len , int attrtype );
235
237
extern size_t nla_strlcpy (char * dst , const struct nlattr * nla ,
236
238
size_t dstsize );
237
239
extern int nla_memcpy (void * dest , const struct nlattr * src , int count );
@@ -346,7 +348,8 @@ static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining)
346
348
* Returns the next netlink message in the message stream and
347
349
* decrements remaining by the size of the current message.
348
350
*/
349
- static inline struct nlmsghdr * nlmsg_next (struct nlmsghdr * nlh , int * remaining )
351
+ static inline struct nlmsghdr *
352
+ nlmsg_next (const struct nlmsghdr * nlh , int * remaining )
350
353
{
351
354
int totlen = NLMSG_ALIGN (nlh -> nlmsg_len );
352
355
@@ -398,7 +401,8 @@ static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
398
401
* @maxtype: maximum attribute type to be expected
399
402
* @policy: validation policy
400
403
*/
401
- static inline int nlmsg_validate (struct nlmsghdr * nlh , int hdrlen , int maxtype ,
404
+ static inline int nlmsg_validate (const struct nlmsghdr * nlh ,
405
+ int hdrlen , int maxtype ,
402
406
const struct nla_policy * policy )
403
407
{
404
408
if (nlh -> nlmsg_len < nlmsg_msg_size (hdrlen ))
@@ -727,7 +731,8 @@ static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
727
731
*
728
732
* Returns the first attribute which matches the specified type.
729
733
*/
730
- static inline struct nlattr * nla_find_nested (struct nlattr * nla , int attrtype )
734
+ static inline struct nlattr *
735
+ nla_find_nested (const struct nlattr * nla , int attrtype )
731
736
{
732
737
return nla_find (nla_data (nla ), nla_len (nla ), attrtype );
733
738
}
@@ -1032,7 +1037,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
1032
1037
*
1033
1038
* Returns 0 on success or a negative error code.
1034
1039
*/
1035
- static inline int nla_validate_nested (struct nlattr * start , int maxtype ,
1040
+ static inline int nla_validate_nested (const struct nlattr * start , int maxtype ,
1036
1041
const struct nla_policy * policy )
1037
1042
{
1038
1043
return nla_validate (nla_data (start ), nla_len (start ), maxtype , policy );
0 commit comments