blob: f5907d23272d48562c69b911e5a0a619e3f4c180 [file] [log] [blame]
Thomas Grafbfa83a92005-11-10 02:25:51 +01001/*
2 * NETLINK Netlink attributes
3 *
4 * Authors: Thomas Graf <tgraf@suug.ch>
5 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
6 */
7
Paul Gortmaker8bc3bcc2011-11-16 21:29:17 -05008#include <linux/export.h>
Thomas Grafbfa83a92005-11-10 02:25:51 +01009#include <linux/kernel.h>
10#include <linux/errno.h>
11#include <linux/jiffies.h>
Thomas Grafbfa83a92005-11-10 02:25:51 +010012#include <linux/skbuff.h>
13#include <linux/string.h>
14#include <linux/types.h>
15#include <net/netlink.h>
16
Jan Engelhardt36546542010-11-16 09:52:32 -080017static const u16 nla_attr_minlen[NLA_TYPE_MAX+1] = {
Thomas Grafbfa83a92005-11-10 02:25:51 +010018 [NLA_U8] = sizeof(u8),
19 [NLA_U16] = sizeof(u16),
20 [NLA_U32] = sizeof(u32),
21 [NLA_U64] = sizeof(u64),
Johannes Bergc30bc942011-11-03 00:07:32 +000022 [NLA_MSECS] = sizeof(u64),
Thomas Grafbfa83a92005-11-10 02:25:51 +010023 [NLA_NESTED] = NLA_HDRLEN,
Julian Anastasov9eca2eb2012-08-25 22:47:57 +000024 [NLA_S8] = sizeof(s8),
25 [NLA_S16] = sizeof(s16),
26 [NLA_S32] = sizeof(s32),
27 [NLA_S64] = sizeof(s64),
Thomas Grafbfa83a92005-11-10 02:25:51 +010028};
29
Jan Engelhardt36546542010-11-16 09:52:32 -080030static int validate_nla(const struct nlattr *nla, int maxtype,
Patrick McHardyef7c79e2007-06-05 12:38:30 -070031 const struct nla_policy *policy)
Thomas Grafbfa83a92005-11-10 02:25:51 +010032{
Patrick McHardyef7c79e2007-06-05 12:38:30 -070033 const struct nla_policy *pt;
Thomas Graf8f4c1f92007-09-12 14:44:36 +020034 int minlen = 0, attrlen = nla_len(nla), type = nla_type(nla);
Thomas Grafbfa83a92005-11-10 02:25:51 +010035
Thomas Graf8f4c1f92007-09-12 14:44:36 +020036 if (type <= 0 || type > maxtype)
Thomas Grafbfa83a92005-11-10 02:25:51 +010037 return 0;
38
Thomas Graf8f4c1f92007-09-12 14:44:36 +020039 pt = &policy[type];
Thomas Grafbfa83a92005-11-10 02:25:51 +010040
41 BUG_ON(pt->type > NLA_TYPE_MAX);
42
Thomas Grafa5531a52006-08-26 20:11:47 -070043 switch (pt->type) {
44 case NLA_FLAG:
45 if (attrlen > 0)
46 return -ERANGE;
47 break;
Thomas Grafbfa83a92005-11-10 02:25:51 +010048
Thomas Grafa5531a52006-08-26 20:11:47 -070049 case NLA_NUL_STRING:
50 if (pt->len)
51 minlen = min_t(int, attrlen, pt->len + 1);
52 else
53 minlen = attrlen;
Thomas Grafbfa83a92005-11-10 02:25:51 +010054
Thomas Grafa5531a52006-08-26 20:11:47 -070055 if (!minlen || memchr(nla_data(nla), '\0', minlen) == NULL)
56 return -EINVAL;
57 /* fall through */
58
59 case NLA_STRING:
60 if (attrlen < 1)
61 return -ERANGE;
62
63 if (pt->len) {
64 char *buf = nla_data(nla);
65
66 if (buf[attrlen - 1] == '\0')
67 attrlen--;
68
69 if (attrlen > pt->len)
70 return -ERANGE;
71 }
72 break;
73
Johannes Bergd30045a2007-03-23 11:37:48 -070074 case NLA_BINARY:
75 if (pt->len && attrlen > pt->len)
76 return -ERANGE;
77 break;
78
Patrick McHardy1092cb22007-06-25 13:49:35 -070079 case NLA_NESTED_COMPAT:
80 if (attrlen < pt->len)
81 return -ERANGE;
82 if (attrlen < NLA_ALIGN(pt->len))
83 break;
84 if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN)
85 return -ERANGE;
86 nla = nla_data(nla) + NLA_ALIGN(pt->len);
87 if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla))
88 return -ERANGE;
89 break;
Patrick McHardyea5693c2008-11-28 03:05:19 -080090 case NLA_NESTED:
91 /* a nested attributes is allowed to be empty; if its not,
92 * it must have a size of at least NLA_HDRLEN.
93 */
94 if (attrlen == 0)
95 break;
Thomas Grafa5531a52006-08-26 20:11:47 -070096 default:
97 if (pt->len)
98 minlen = pt->len;
99 else if (pt->type != NLA_UNSPEC)
100 minlen = nla_attr_minlen[pt->type];
101
102 if (attrlen < minlen)
103 return -ERANGE;
104 }
Thomas Grafbfa83a92005-11-10 02:25:51 +0100105
106 return 0;
107}
108
109/**
110 * nla_validate - Validate a stream of attributes
111 * @head: head of attribute stream
112 * @len: length of attribute stream
113 * @maxtype: maximum attribute type to be expected
114 * @policy: validation policy
115 *
116 * Validates all attributes in the specified attribute stream against the
117 * specified policy. Attributes with a type exceeding maxtype will be
118 * ignored. See documenation of struct nla_policy for more details.
119 *
120 * Returns 0 on success or a negative error code.
121 */
Jan Engelhardt36546542010-11-16 09:52:32 -0800122int nla_validate(const struct nlattr *head, int len, int maxtype,
Patrick McHardyef7c79e2007-06-05 12:38:30 -0700123 const struct nla_policy *policy)
Thomas Grafbfa83a92005-11-10 02:25:51 +0100124{
Jan Engelhardt36546542010-11-16 09:52:32 -0800125 const struct nlattr *nla;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100126 int rem, err;
127
128 nla_for_each_attr(nla, head, len, rem) {
129 err = validate_nla(nla, maxtype, policy);
130 if (err < 0)
131 goto errout;
132 }
133
134 err = 0;
135errout:
136 return err;
137}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700138EXPORT_SYMBOL(nla_validate);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100139
140/**
Holger Eitzenbergere487eb92009-03-25 18:26:30 +0100141 * nla_policy_len - Determin the max. length of a policy
142 * @policy: policy to use
143 * @n: number of policies
144 *
145 * Determines the max. length of the policy. It is currently used
146 * to allocated Netlink buffers roughly the size of the actual
147 * message.
148 *
149 * Returns 0 on success or a negative error code.
150 */
151int
152nla_policy_len(const struct nla_policy *p, int n)
153{
154 int i, len = 0;
155
Lars Ellenberge3fa3af2011-02-28 12:38:25 -0800156 for (i = 0; i < n; i++, p++) {
Holger Eitzenbergere487eb92009-03-25 18:26:30 +0100157 if (p->len)
158 len += nla_total_size(p->len);
159 else if (nla_attr_minlen[p->type])
160 len += nla_total_size(nla_attr_minlen[p->type]);
161 }
162
163 return len;
164}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700165EXPORT_SYMBOL(nla_policy_len);
Holger Eitzenbergere487eb92009-03-25 18:26:30 +0100166
167/**
Thomas Grafbfa83a92005-11-10 02:25:51 +0100168 * nla_parse - Parse a stream of attributes into a tb buffer
169 * @tb: destination array with maxtype+1 elements
170 * @maxtype: maximum attribute type to be expected
171 * @head: head of attribute stream
172 * @len: length of attribute stream
Julius Volz10b595a2008-06-27 20:02:14 -0700173 * @policy: validation policy
Thomas Grafbfa83a92005-11-10 02:25:51 +0100174 *
175 * Parses a stream of attributes and stores a pointer to each attribute in
Uwe Kleine-Königb5950762010-11-01 15:38:34 -0400176 * the tb array accessible via the attribute type. Attributes with a type
Thomas Grafbfa83a92005-11-10 02:25:51 +0100177 * exceeding maxtype will be silently ignored for backwards compatibility
178 * reasons. policy may be set to NULL if no validation is required.
179 *
180 * Returns 0 on success or a negative error code.
181 */
Jan Engelhardt36546542010-11-16 09:52:32 -0800182int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
183 int len, const struct nla_policy *policy)
Thomas Grafbfa83a92005-11-10 02:25:51 +0100184{
Jan Engelhardt36546542010-11-16 09:52:32 -0800185 const struct nlattr *nla;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100186 int rem, err;
187
188 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
189
190 nla_for_each_attr(nla, head, len, rem) {
Thomas Graf8f4c1f92007-09-12 14:44:36 +0200191 u16 type = nla_type(nla);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100192
193 if (type > 0 && type <= maxtype) {
194 if (policy) {
195 err = validate_nla(nla, maxtype, policy);
196 if (err < 0)
197 goto errout;
198 }
199
Jan Engelhardt36546542010-11-16 09:52:32 -0800200 tb[type] = (struct nlattr *)nla;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100201 }
202 }
203
204 if (unlikely(rem > 0))
Michal Schmidtbfc51842014-06-02 18:25:02 +0200205 pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n",
206 rem, current->comm);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100207
208 err = 0;
209errout:
210 return err;
211}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700212EXPORT_SYMBOL(nla_parse);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100213
214/**
215 * nla_find - Find a specific attribute in a stream of attributes
216 * @head: head of attribute stream
217 * @len: length of attribute stream
218 * @attrtype: type of attribute to look for
219 *
220 * Returns the first attribute in the stream matching the specified type.
221 */
Jan Engelhardt36546542010-11-16 09:52:32 -0800222struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype)
Thomas Grafbfa83a92005-11-10 02:25:51 +0100223{
Jan Engelhardt36546542010-11-16 09:52:32 -0800224 const struct nlattr *nla;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100225 int rem;
226
227 nla_for_each_attr(nla, head, len, rem)
Thomas Graf8f4c1f92007-09-12 14:44:36 +0200228 if (nla_type(nla) == attrtype)
Jan Engelhardt36546542010-11-16 09:52:32 -0800229 return (struct nlattr *)nla;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100230
231 return NULL;
232}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700233EXPORT_SYMBOL(nla_find);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100234
235/**
236 * nla_strlcpy - Copy string attribute payload into a sized buffer
237 * @dst: where to copy the string to
Julius Volz10b595a2008-06-27 20:02:14 -0700238 * @nla: attribute to copy the string from
Thomas Grafbfa83a92005-11-10 02:25:51 +0100239 * @dstsize: size of destination buffer
240 *
241 * Copies at most dstsize - 1 bytes into the destination buffer.
242 * The result is always a valid NUL-terminated string. Unlike
243 * strlcpy the destination buffer is always padded out.
244 *
245 * Returns the length of the source buffer.
246 */
247size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize)
248{
249 size_t srclen = nla_len(nla);
250 char *src = nla_data(nla);
251
252 if (srclen > 0 && src[srclen - 1] == '\0')
253 srclen--;
254
255 if (dstsize > 0) {
256 size_t len = (srclen >= dstsize) ? dstsize - 1 : srclen;
257
258 memset(dst, 0, dstsize);
259 memcpy(dst, src, len);
260 }
261
262 return srclen;
263}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700264EXPORT_SYMBOL(nla_strlcpy);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100265
266/**
267 * nla_memcpy - Copy a netlink attribute into another memory area
268 * @dest: where to copy to memcpy
269 * @src: netlink attribute to copy from
270 * @count: size of the destination area
271 *
272 * Note: The number of bytes copied is limited by the length of
273 * attribute's payload. memcpy
274 *
275 * Returns the number of bytes copied.
276 */
Patrick McHardyb057efd2008-10-28 11:59:11 -0700277int nla_memcpy(void *dest, const struct nlattr *src, int count)
Thomas Grafbfa83a92005-11-10 02:25:51 +0100278{
279 int minlen = min_t(int, count, nla_len(src));
280
281 memcpy(dest, nla_data(src), minlen);
Jiri Benc5899f042015-03-29 16:05:28 +0200282 if (count > minlen)
283 memset(dest + minlen, 0, count - minlen);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100284
285 return minlen;
286}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700287EXPORT_SYMBOL(nla_memcpy);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100288
289/**
290 * nla_memcmp - Compare an attribute with sized memory area
291 * @nla: netlink attribute
292 * @data: memory area
293 * @size: size of memory area
294 */
295int nla_memcmp(const struct nlattr *nla, const void *data,
296 size_t size)
297{
298 int d = nla_len(nla) - size;
299
300 if (d == 0)
301 d = memcmp(nla_data(nla), data, size);
302
303 return d;
304}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700305EXPORT_SYMBOL(nla_memcmp);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100306
307/**
308 * nla_strcmp - Compare a string attribute against a string
309 * @nla: netlink string attribute
310 * @str: another string
311 */
312int nla_strcmp(const struct nlattr *nla, const char *str)
313{
Pablo Neira8b7b9322014-04-01 19:38:44 +0200314 int len = strlen(str);
315 char *buf = nla_data(nla);
316 int attrlen = nla_len(nla);
317 int d;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100318
Pablo Neira8b7b9322014-04-01 19:38:44 +0200319 if (attrlen > 0 && buf[attrlen - 1] == '\0')
320 attrlen--;
321
322 d = attrlen - len;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100323 if (d == 0)
324 d = memcmp(nla_data(nla), str, len);
325
326 return d;
327}
Fabian Frederick6d6a1382014-06-04 16:11:57 -0700328EXPORT_SYMBOL(nla_strcmp);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100329
Herbert Xu90800212009-03-11 23:18:32 +0800330#ifdef CONFIG_NET
Thomas Grafbfa83a92005-11-10 02:25:51 +0100331/**
332 * __nla_reserve - reserve room for attribute on the skb
333 * @skb: socket buffer to reserve room on
334 * @attrtype: attribute type
335 * @attrlen: length of attribute payload
336 *
337 * Adds a netlink attribute header to a socket buffer and reserves
338 * room for the payload but does not copy it.
339 *
340 * The caller is responsible to ensure that the skb provides enough
341 * tailroom for the attribute header and payload.
342 */
343struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen)
344{
345 struct nlattr *nla;
346
347 nla = (struct nlattr *) skb_put(skb, nla_total_size(attrlen));
348 nla->nla_type = attrtype;
349 nla->nla_len = nla_attr_size(attrlen);
350
351 memset((unsigned char *) nla + nla->nla_len, 0, nla_padlen(attrlen));
352
353 return nla;
354}
Herbert Xu90800212009-03-11 23:18:32 +0800355EXPORT_SYMBOL(__nla_reserve);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100356
357/**
Thomas Graffe4944e2006-08-04 23:03:05 -0700358 * __nla_reserve_nohdr - reserve room for attribute without header
359 * @skb: socket buffer to reserve room on
360 * @attrlen: length of attribute payload
361 *
362 * Reserves room for attribute payload without a header.
363 *
364 * The caller is responsible to ensure that the skb provides enough
365 * tailroom for the payload.
366 */
367void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen)
368{
369 void *start;
370
371 start = skb_put(skb, NLA_ALIGN(attrlen));
372 memset(start, 0, NLA_ALIGN(attrlen));
373
374 return start;
375}
Herbert Xu90800212009-03-11 23:18:32 +0800376EXPORT_SYMBOL(__nla_reserve_nohdr);
Thomas Graffe4944e2006-08-04 23:03:05 -0700377
378/**
Thomas Grafbfa83a92005-11-10 02:25:51 +0100379 * nla_reserve - reserve room for attribute on the skb
380 * @skb: socket buffer to reserve room on
381 * @attrtype: attribute type
382 * @attrlen: length of attribute payload
383 *
384 * Adds a netlink attribute header to a socket buffer and reserves
385 * room for the payload but does not copy it.
386 *
387 * Returns NULL if the tailroom of the skb is insufficient to store
388 * the attribute header and payload.
389 */
390struct nlattr *nla_reserve(struct sk_buff *skb, int attrtype, int attrlen)
391{
392 if (unlikely(skb_tailroom(skb) < nla_total_size(attrlen)))
393 return NULL;
394
395 return __nla_reserve(skb, attrtype, attrlen);
396}
Herbert Xu90800212009-03-11 23:18:32 +0800397EXPORT_SYMBOL(nla_reserve);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100398
399/**
Julius Volz10b595a2008-06-27 20:02:14 -0700400 * nla_reserve_nohdr - reserve room for attribute without header
Thomas Graffe4944e2006-08-04 23:03:05 -0700401 * @skb: socket buffer to reserve room on
Julius Volz10b595a2008-06-27 20:02:14 -0700402 * @attrlen: length of attribute payload
Thomas Graffe4944e2006-08-04 23:03:05 -0700403 *
404 * Reserves room for attribute payload without a header.
405 *
406 * Returns NULL if the tailroom of the skb is insufficient to store
407 * the attribute payload.
408 */
409void *nla_reserve_nohdr(struct sk_buff *skb, int attrlen)
410{
411 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen)))
412 return NULL;
413
414 return __nla_reserve_nohdr(skb, attrlen);
415}
Herbert Xu90800212009-03-11 23:18:32 +0800416EXPORT_SYMBOL(nla_reserve_nohdr);
Thomas Graffe4944e2006-08-04 23:03:05 -0700417
418/**
Thomas Grafbfa83a92005-11-10 02:25:51 +0100419 * __nla_put - Add a netlink attribute to a socket buffer
420 * @skb: socket buffer to add attribute to
421 * @attrtype: attribute type
422 * @attrlen: length of attribute payload
423 * @data: head of attribute payload
424 *
425 * The caller is responsible to ensure that the skb provides enough
426 * tailroom for the attribute header and payload.
427 */
428void __nla_put(struct sk_buff *skb, int attrtype, int attrlen,
429 const void *data)
430{
431 struct nlattr *nla;
432
433 nla = __nla_reserve(skb, attrtype, attrlen);
434 memcpy(nla_data(nla), data, attrlen);
435}
Herbert Xu90800212009-03-11 23:18:32 +0800436EXPORT_SYMBOL(__nla_put);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100437
Thomas Graffe4944e2006-08-04 23:03:05 -0700438/**
439 * __nla_put_nohdr - Add a netlink attribute without header
440 * @skb: socket buffer to add attribute to
441 * @attrlen: length of attribute payload
442 * @data: head of attribute payload
443 *
444 * The caller is responsible to ensure that the skb provides enough
445 * tailroom for the attribute payload.
446 */
447void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data)
448{
449 void *start;
450
451 start = __nla_reserve_nohdr(skb, attrlen);
452 memcpy(start, data, attrlen);
453}
Herbert Xu90800212009-03-11 23:18:32 +0800454EXPORT_SYMBOL(__nla_put_nohdr);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100455
456/**
457 * nla_put - Add a netlink attribute to a socket buffer
458 * @skb: socket buffer to add attribute to
459 * @attrtype: attribute type
460 * @attrlen: length of attribute payload
461 * @data: head of attribute payload
462 *
Thomas Grafbc3ed282008-06-03 16:36:54 -0700463 * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store
Thomas Grafbfa83a92005-11-10 02:25:51 +0100464 * the attribute header and payload.
465 */
466int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
467{
468 if (unlikely(skb_tailroom(skb) < nla_total_size(attrlen)))
Thomas Grafbc3ed282008-06-03 16:36:54 -0700469 return -EMSGSIZE;
Thomas Grafbfa83a92005-11-10 02:25:51 +0100470
471 __nla_put(skb, attrtype, attrlen, data);
472 return 0;
473}
Herbert Xu90800212009-03-11 23:18:32 +0800474EXPORT_SYMBOL(nla_put);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100475
Thomas Graffe4944e2006-08-04 23:03:05 -0700476/**
477 * nla_put_nohdr - Add a netlink attribute without header
478 * @skb: socket buffer to add attribute to
479 * @attrlen: length of attribute payload
480 * @data: head of attribute payload
481 *
Thomas Grafbc3ed282008-06-03 16:36:54 -0700482 * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store
Thomas Graffe4944e2006-08-04 23:03:05 -0700483 * the attribute payload.
484 */
485int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data)
486{
487 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen)))
Thomas Grafbc3ed282008-06-03 16:36:54 -0700488 return -EMSGSIZE;
Thomas Graffe4944e2006-08-04 23:03:05 -0700489
490 __nla_put_nohdr(skb, attrlen, data);
491 return 0;
492}
Herbert Xu90800212009-03-11 23:18:32 +0800493EXPORT_SYMBOL(nla_put_nohdr);
Thomas Grafbfa83a92005-11-10 02:25:51 +0100494
Patrick McHardy01480e12008-01-22 22:10:59 -0800495/**
496 * nla_append - Add a netlink attribute without header or padding
497 * @skb: socket buffer to add attribute to
498 * @attrlen: length of attribute payload
499 * @data: head of attribute payload
500 *
Thomas Grafbc3ed282008-06-03 16:36:54 -0700501 * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store
Patrick McHardy01480e12008-01-22 22:10:59 -0800502 * the attribute payload.
503 */
504int nla_append(struct sk_buff *skb, int attrlen, const void *data)
505{
506 if (unlikely(skb_tailroom(skb) < NLA_ALIGN(attrlen)))
Thomas Grafbc3ed282008-06-03 16:36:54 -0700507 return -EMSGSIZE;
Patrick McHardy01480e12008-01-22 22:10:59 -0800508
509 memcpy(skb_put(skb, attrlen), data, attrlen);
510 return 0;
511}
Herbert Xu90800212009-03-11 23:18:32 +0800512EXPORT_SYMBOL(nla_append);
513#endif