From: Thomas Graf Date: Thu, 28 Nov 2013 22:14:38 +0000 (+0100) Subject: attr: Allow attribute type 0 X-Git-Tag: libnl3_2_24rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a8d90f5fec4;p=thirdparty%2Flibnl.git attr: Allow attribute type 0 {netlink,packet,unix}_diag use attribute type 0 for valid attributes. The value was reserved and usage was prohibited by the protocol but we can't undo the breakge. Make libnl accept attribute type 0 to allow parsing these attributes. Reported-by: Nicolas Dichtel Signed-off-by: Thomas Graf --- diff --git a/lib/attr.c b/lib/attr.c index 535f10c..e83aca2 100644 --- a/lib/attr.c +++ b/lib/attr.c @@ -192,7 +192,7 @@ static int validate_nla(struct nlattr *nla, int maxtype, unsigned int minlen = 0; int type = nla_type(nla); - if (type <= 0 || type > maxtype) + if (type < 0 || type > maxtype) return 0; pt = &policy[type];