summaryrefslogtreecommitdiffstats
path: root/net/netlink/attr.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-03-23 19:37:48 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 07:28:05 +0200
commitd30045a0bcf144753869175dd9d840f7ceaf4aba (patch)
treea5f5b5f7073fbd733a7c5ac877161018f43cf1fc /net/netlink/attr.c
parent[SCTP]: Implement SCTP_MAX_BURST socket option. (diff)
downloadlinux-d30045a0bcf144753869175dd9d840f7ceaf4aba.tar.xz
linux-d30045a0bcf144753869175dd9d840f7ceaf4aba.zip
[NETLINK]: introduce NLA_BINARY type
This patch introduces a new NLA_BINARY attribute policy type with the verification of simply checking the maximum length of the payload. It also fixes a small typo in the example. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/netlink/attr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/netlink/attr.c b/net/netlink/attr.c
index 004139557e09..df5f820a4c32 100644
--- a/net/netlink/attr.c
+++ b/net/netlink/attr.c
@@ -67,6 +67,11 @@ static int validate_nla(struct nlattr *nla, int maxtype,
}
break;
+ case NLA_BINARY:
+ if (pt->len && attrlen > pt->len)
+ return -ERANGE;
+ break;
+
default:
if (pt->len)
minlen = pt->len;