[NETFILTER] nfnetlink: nfattr_parse() can never fail, make it void
nfattr_parse (and thus nfattr_parse_nested) always returns success. So we can make them 'void' and remove all the checking at the caller side. Based on original patch by Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
eaae4fa45e
commit
a2506c0432
@@ -128,7 +128,7 @@ void __nfa_fill(struct sk_buff *skb, int attrtype, int attrlen,
|
||||
memset(NFA_DATA(nfa) + attrlen, 0, NFA_ALIGN(size) - size);
|
||||
}
|
||||
|
||||
int nfattr_parse(struct nfattr *tb[], int maxattr, struct nfattr *nfa, int len)
|
||||
void nfattr_parse(struct nfattr *tb[], int maxattr, struct nfattr *nfa, int len)
|
||||
{
|
||||
memset(tb, 0, sizeof(struct nfattr *) * maxattr);
|
||||
|
||||
@@ -138,8 +138,6 @@ int nfattr_parse(struct nfattr *tb[], int maxattr, struct nfattr *nfa, int len)
|
||||
tb[flavor-1] = nfa;
|
||||
nfa = NFA_NEXT(nfa, len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user