diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 15:30:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 15:30:19 -0500 |
commit | abb359450f20c32ae03039d8736f12b1d561caf5 (patch) | |
tree | 6e8723885feb66a138f19f0ff31615dc13a8d859 /lib/nlattr.c | |
parent | cb600d2f83c854ec3d6660063e4466431999489b (diff) | |
parent | 4e3dbdb1392a83bd21a6ff8f6bc785495058d37c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1436 commits)
cassini: Use local-mac-address prom property for Cassini MAC address
net: remove the duplicate #ifdef __KERNEL__
net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
netconsole: clarify stopping message
netconsole: don't announce stopping if nothing happened
cnic: Fix the type field in SPQ messages
netfilter: fix export secctx error handling
netfilter: fix the race when initializing nf_ct_expect_hash_rnd
ipv4: IP defragmentation must be ECN aware
net: r6040: Return proper error for r6040_init_one
dcb: use after free in dcb_flushapp()
dcb: unlock on error in dcbnl_ieee_get()
net: ixp4xx_eth: Return proper error for eth_init_one
include/linux/if_ether.h: Add #define ETH_P_LINK_CTL for HPNA and wlan local tunnel
net: add POLLPRI to sock_def_readable()
af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
net_sched: pfifo_head_drop problem
mac80211: remove stray extern
mac80211: implement off-channel TX using hw r-o-c offload
mac80211: implement hardware offload for remain-on-channel
...
Diffstat (limited to 'lib/nlattr.c')
-rw-r--r-- | lib/nlattr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c index c4706eb98d3..00e8a02681a 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <net/netlink.h> | 16 | #include <net/netlink.h> |
17 | 17 | ||
18 | static u16 nla_attr_minlen[NLA_TYPE_MAX+1] __read_mostly = { | 18 | static const u16 nla_attr_minlen[NLA_TYPE_MAX+1] = { |
19 | [NLA_U8] = sizeof(u8), | 19 | [NLA_U8] = sizeof(u8), |
20 | [NLA_U16] = sizeof(u16), | 20 | [NLA_U16] = sizeof(u16), |
21 | [NLA_U32] = sizeof(u32), | 21 | [NLA_U32] = sizeof(u32), |
@@ -23,7 +23,7 @@ static u16 nla_attr_minlen[NLA_TYPE_MAX+1] __read_mostly = { | |||
23 | [NLA_NESTED] = NLA_HDRLEN, | 23 | [NLA_NESTED] = NLA_HDRLEN, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | static int validate_nla(struct nlattr *nla, int maxtype, | 26 | static int validate_nla(const struct nlattr *nla, int maxtype, |
27 | const struct nla_policy *policy) | 27 | const struct nla_policy *policy) |
28 | { | 28 | { |
29 | const struct nla_policy *pt; | 29 | const struct nla_policy *pt; |
@@ -115,10 +115,10 @@ static int validate_nla(struct nlattr *nla, int maxtype, | |||
115 | * | 115 | * |
116 | * Returns 0 on success or a negative error code. | 116 | * Returns 0 on success or a negative error code. |
117 | */ | 117 | */ |
118 | int nla_validate(struct nlattr *head, int len, int maxtype, | 118 | int nla_validate(const struct nlattr *head, int len, int maxtype, |
119 | const struct nla_policy *policy) | 119 | const struct nla_policy *policy) |
120 | { | 120 | { |
121 | struct nlattr *nla; | 121 | const struct nlattr *nla; |
122 | int rem, err; | 122 | int rem, err; |
123 | 123 | ||
124 | nla_for_each_attr(nla, head, len, rem) { | 124 | nla_for_each_attr(nla, head, len, rem) { |
@@ -173,10 +173,10 @@ nla_policy_len(const struct nla_policy *p, int n) | |||
173 | * | 173 | * |
174 | * Returns 0 on success or a negative error code. | 174 | * Returns 0 on success or a negative error code. |
175 | */ | 175 | */ |
176 | int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, | 176 | int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, |
177 | const struct nla_policy *policy) | 177 | int len, const struct nla_policy *policy) |
178 | { | 178 | { |
179 | struct nlattr *nla; | 179 | const struct nlattr *nla; |
180 | int rem, err; | 180 | int rem, err; |
181 | 181 | ||
182 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); | 182 | memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); |
@@ -191,7 +191,7 @@ int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, | |||
191 | goto errout; | 191 | goto errout; |
192 | } | 192 | } |
193 | 193 | ||
194 | tb[type] = nla; | 194 | tb[type] = (struct nlattr *)nla; |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
@@ -212,14 +212,14 @@ errout: | |||
212 | * | 212 | * |
213 | * Returns the first attribute in the stream matching the specified type. | 213 | * Returns the first attribute in the stream matching the specified type. |
214 | */ | 214 | */ |
215 | struct nlattr *nla_find(struct nlattr *head, int len, int attrtype) | 215 | struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype) |
216 | { | 216 | { |
217 | struct nlattr *nla; | 217 | const struct nlattr *nla; |
218 | int rem; | 218 | int rem; |
219 | 219 | ||
220 | nla_for_each_attr(nla, head, len, rem) | 220 | nla_for_each_attr(nla, head, len, rem) |
221 | if (nla_type(nla) == attrtype) | 221 | if (nla_type(nla) == attrtype) |
222 | return nla; | 222 | return (struct nlattr *)nla; |
223 | 223 | ||
224 | return NULL; | 224 | return NULL; |
225 | } | 225 | } |