aboutsummaryrefslogtreecommitdiffstats
path: root/lib/nlattr.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-03-11 11:18:32 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-03-11 11:18:32 -0400
commit908002161247e6e68c478052926b62d9a3d72418 (patch)
treedfba008f48ffd2ca6c34eff07105f6cd26eaf60e /lib/nlattr.c
parent0c01aed50d4844f54f59e875e05d211e80874464 (diff)
nlattr: Fix build error with NET off
We moved the netlink attribute support from net to lib in order for it to be available for general consumption. However, parts of the code (the bits that we don't need :) really depends on NET because the target object is sk_buff. This patch fixes this by wrapping them in CONFIG_NET. Some EXPORTs have been moved to make this work. Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'lib/nlattr.c')
-rw-r--r--lib/nlattr.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c
index 56c3ce7fe29a..80009a24e21d 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -281,6 +281,7 @@ int nla_strcmp(const struct nlattr *nla, const char *str)
281 return d; 281 return d;
282} 282}
283 283
284#ifdef CONFIG_NET
284/** 285/**
285 * __nla_reserve - reserve room for attribute on the skb 286 * __nla_reserve - reserve room for attribute on the skb
286 * @skb: socket buffer to reserve room on 287 * @skb: socket buffer to reserve room on
@@ -305,6 +306,7 @@ struct nlattr *__nla_reserve(struct sk_buff *skb, int attrtype, int attrlen)
305 306
306 return nla; 307 return nla;
307} 308}
309EXPORT_SYMBOL(__nla_reserve);
308 310
309/** 311/**
310 * __nla_reserve_nohdr - reserve room for attribute without header 312 * __nla_reserve_nohdr - reserve room for attribute without header
@@ -325,6 +327,7 @@ void *__nla_reserve_nohdr(struct sk_buff *skb, int attrlen)
325 327
326 return start; 328 return start;
327} 329}
330EXPORT_SYMBOL(__nla_reserve_nohdr);
328 331
329/** 332/**
330 * nla_reserve - reserve room for attribute on the skb 333 * nla_reserve - reserve room for attribute on the skb
@@ -345,6 +348,7 @@ struct nlattr *nla_reserve(struct sk_buff *skb, int attrtype, int attrlen)
345 348
346 return __nla_reserve(skb, attrtype, attrlen); 349 return __nla_reserve(skb, attrtype, attrlen);
347} 350}
351EXPORT_SYMBOL(nla_reserve);
348 352
349/** 353/**
350 * nla_reserve_nohdr - reserve room for attribute without header 354 * nla_reserve_nohdr - reserve room for attribute without header
@@ -363,6 +367,7 @@ void *nla_reserve_nohdr(struct sk_buff *skb, int attrlen)
363 367
364 return __nla_reserve_nohdr(skb, attrlen); 368 return __nla_reserve_nohdr(skb, attrlen);
365} 369}
370EXPORT_SYMBOL(nla_reserve_nohdr);
366 371
367/** 372/**
368 * __nla_put - Add a netlink attribute to a socket buffer 373 * __nla_put - Add a netlink attribute to a socket buffer
@@ -382,6 +387,7 @@ void __nla_put(struct sk_buff *skb, int attrtype, int attrlen,
382 nla = __nla_reserve(skb, attrtype, attrlen); 387 nla = __nla_reserve(skb, attrtype, attrlen);
383 memcpy(nla_data(nla), data, attrlen); 388 memcpy(nla_data(nla), data, attrlen);
384} 389}
390EXPORT_SYMBOL(__nla_put);
385 391
386/** 392/**
387 * __nla_put_nohdr - Add a netlink attribute without header 393 * __nla_put_nohdr - Add a netlink attribute without header
@@ -399,6 +405,7 @@ void __nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data)
399 start = __nla_reserve_nohdr(skb, attrlen); 405 start = __nla_reserve_nohdr(skb, attrlen);
400 memcpy(start, data, attrlen); 406 memcpy(start, data, attrlen);
401} 407}
408EXPORT_SYMBOL(__nla_put_nohdr);
402 409
403/** 410/**
404 * nla_put - Add a netlink attribute to a socket buffer 411 * nla_put - Add a netlink attribute to a socket buffer
@@ -418,6 +425,7 @@ int nla_put(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
418 __nla_put(skb, attrtype, attrlen, data); 425 __nla_put(skb, attrtype, attrlen, data);
419 return 0; 426 return 0;
420} 427}
428EXPORT_SYMBOL(nla_put);
421 429
422/** 430/**
423 * nla_put_nohdr - Add a netlink attribute without header 431 * nla_put_nohdr - Add a netlink attribute without header
@@ -436,6 +444,7 @@ int nla_put_nohdr(struct sk_buff *skb, int attrlen, const void *data)
436 __nla_put_nohdr(skb, attrlen, data); 444 __nla_put_nohdr(skb, attrlen, data);
437 return 0; 445 return 0;
438} 446}
447EXPORT_SYMBOL(nla_put_nohdr);
439 448
440/** 449/**
441 * nla_append - Add a netlink attribute without header or padding 450 * nla_append - Add a netlink attribute without header or padding
@@ -454,20 +463,13 @@ int nla_append(struct sk_buff *skb, int attrlen, const void *data)
454 memcpy(skb_put(skb, attrlen), data, attrlen); 463 memcpy(skb_put(skb, attrlen), data, attrlen);
455 return 0; 464 return 0;
456} 465}
466EXPORT_SYMBOL(nla_append);
467#endif
457 468
458EXPORT_SYMBOL(nla_validate); 469EXPORT_SYMBOL(nla_validate);
459EXPORT_SYMBOL(nla_parse); 470EXPORT_SYMBOL(nla_parse);
460EXPORT_SYMBOL(nla_find); 471EXPORT_SYMBOL(nla_find);
461EXPORT_SYMBOL(nla_strlcpy); 472EXPORT_SYMBOL(nla_strlcpy);
462EXPORT_SYMBOL(__nla_reserve);
463EXPORT_SYMBOL(__nla_reserve_nohdr);
464EXPORT_SYMBOL(nla_reserve);
465EXPORT_SYMBOL(nla_reserve_nohdr);
466EXPORT_SYMBOL(__nla_put);
467EXPORT_SYMBOL(__nla_put_nohdr);
468EXPORT_SYMBOL(nla_put);
469EXPORT_SYMBOL(nla_put_nohdr);
470EXPORT_SYMBOL(nla_memcpy); 473EXPORT_SYMBOL(nla_memcpy);
471EXPORT_SYMBOL(nla_memcmp); 474EXPORT_SYMBOL(nla_memcmp);
472EXPORT_SYMBOL(nla_strcmp); 475EXPORT_SYMBOL(nla_strcmp);
473EXPORT_SYMBOL(nla_append);