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 <nicolas.dichtel@6wind.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
bda0f668b6
commit
6a8d90f5fe
1 changed files with 1 additions and 1 deletions
|
@ -192,7 +192,7 @@ static int validate_nla(struct nlattr *nla, int maxtype,
|
||||||
unsigned int minlen = 0;
|
unsigned int minlen = 0;
|
||||||
int type = nla_type(nla);
|
int type = nla_type(nla);
|
||||||
|
|
||||||
if (type <= 0 || type > maxtype)
|
if (type < 0 || type > maxtype)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pt = &policy[type];
|
pt = &policy[type];
|
||||||
|
|
Loading…
Add table
Reference in a new issue