diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-27 21:35:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-27 21:35:03 -0400 |
commit | 5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (patch) | |
tree | 357258d77e2153ef7409926773655c5f8775a1f3 /lib | |
parent | 7b616c8a2f5c8507b4aed6907336ec5b85803a39 (diff) | |
parent | 0870352bc6e0dee485c86a0c99dd60e7089c8917 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (166 commits)
Revert "ax25: zero length frame filtering in AX25"
Revert "netrom: zero length frame filtering in NetRom"
cfg80211: default CONFIG_WIRELESS_OLD_REGULATORY to n
mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi
mac80211: fix aggregation to not require queue stop
mac80211: add skb length sanity checking
mac80211: unify and fix TX aggregation start
mac80211: clean up __ieee80211_tx args
mac80211: rework the pending packets code
mac80211: fix A-MPDU queue assignment
mac80211: rewrite fragmentation
iwlwifi: show current driver status in user readable format
b43: Add BCM4307 PCI-ID
cfg80211: fix locking in nl80211_set_wiphy
mac80211: fix RX path
ath5k: properly drop packets from ops->tx
ar9170: single module build
ath9k: fix dma mapping leak of rx buffer upon rmmod
rt2x00: New USB ID for rt73usb
ath5k: warn and correct rate for unknown hw rate indexes
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/nlattr.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c index 80009a24e21d..c4706eb98d3d 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c | |||
@@ -133,6 +133,32 @@ errout: | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * nla_policy_len - Determin the max. length of a policy | ||
137 | * @policy: policy to use | ||
138 | * @n: number of policies | ||
139 | * | ||
140 | * Determines the max. length of the policy. It is currently used | ||
141 | * to allocated Netlink buffers roughly the size of the actual | ||
142 | * message. | ||
143 | * | ||
144 | * Returns 0 on success or a negative error code. | ||
145 | */ | ||
146 | int | ||
147 | nla_policy_len(const struct nla_policy *p, int n) | ||
148 | { | ||
149 | int i, len = 0; | ||
150 | |||
151 | for (i = 0; i < n; i++) { | ||
152 | if (p->len) | ||
153 | len += nla_total_size(p->len); | ||
154 | else if (nla_attr_minlen[p->type]) | ||
155 | len += nla_total_size(nla_attr_minlen[p->type]); | ||
156 | } | ||
157 | |||
158 | return len; | ||
159 | } | ||
160 | |||
161 | /** | ||
136 | * nla_parse - Parse a stream of attributes into a tb buffer | 162 | * nla_parse - Parse a stream of attributes into a tb buffer |
137 | * @tb: destination array with maxtype+1 elements | 163 | * @tb: destination array with maxtype+1 elements |
138 | * @maxtype: maximum attribute type to be expected | 164 | * @maxtype: maximum attribute type to be expected |
@@ -467,6 +493,7 @@ EXPORT_SYMBOL(nla_append); | |||
467 | #endif | 493 | #endif |
468 | 494 | ||
469 | EXPORT_SYMBOL(nla_validate); | 495 | EXPORT_SYMBOL(nla_validate); |
496 | EXPORT_SYMBOL(nla_policy_len); | ||
470 | EXPORT_SYMBOL(nla_parse); | 497 | EXPORT_SYMBOL(nla_parse); |
471 | EXPORT_SYMBOL(nla_find); | 498 | EXPORT_SYMBOL(nla_find); |
472 | EXPORT_SYMBOL(nla_strlcpy); | 499 | EXPORT_SYMBOL(nla_strlcpy); |