git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ext4: preserve the needs_recovery flag when the journal is aborted
[pandora-kernel.git]
/
lib
/
nlattr.c
diff --git
a/lib/nlattr.c
b/lib/nlattr.c
index
ac09f22
..
be25e35
100644
(file)
--- a/
lib/nlattr.c
+++ b/
lib/nlattr.c
@@
-12,6
+12,8
@@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/string.h>
+#include <linux/ratelimit.h>
+#include <linux/sched.h>
#include <linux/types.h>
#include <net/netlink.h>
#include <linux/types.h>
#include <net/netlink.h>
@@
-20,6
+22,7
@@
static const u16 nla_attr_minlen[NLA_TYPE_MAX+1] = {
[NLA_U16] = sizeof(u16),
[NLA_U32] = sizeof(u32),
[NLA_U64] = sizeof(u64),
[NLA_U16] = sizeof(u16),
[NLA_U32] = sizeof(u32),
[NLA_U64] = sizeof(u64),
+ [NLA_MSECS] = sizeof(u64),
[NLA_NESTED] = NLA_HDRLEN,
};
[NLA_NESTED] = NLA_HDRLEN,
};
@@
-196,8
+199,8
@@
int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
}
if (unlikely(rem > 0))
}
if (unlikely(rem > 0))
- pr
intk(KERN_WARNING "netlink: %d bytes leftover after parsing "
-
"attributes.\n", re
m);
+ pr
_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n",
+
rem, current->com
m);
err = 0;
errout:
err = 0;
errout:
@@
-298,9
+301,15
@@
int nla_memcmp(const struct nlattr *nla, const void *data,
*/
int nla_strcmp(const struct nlattr *nla, const char *str)
{
*/
int nla_strcmp(const struct nlattr *nla, const char *str)
{
- int len = strlen(str) + 1;
- int d = nla_len(nla) - len;
+ int len = strlen(str);
+ char *buf = nla_data(nla);
+ int attrlen = nla_len(nla);
+ int d;
+ if (attrlen > 0 && buf[attrlen - 1] == '\0')
+ attrlen--;
+
+ d = attrlen - len;
if (d == 0)
d = memcmp(nla_data(nla), str, len);
if (d == 0)
d = memcmp(nla_data(nla), str, len);