diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-01-07 04:15:05 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 01:25:03 +0100 |
commit | 0ab03c2b1478f2438d2c80204f7fef65b1bca9cf (patch) | |
tree | a130abc7a3cc2d5c326b1bbdad80c06e741db3fd /net/ipv4 | |
parent | forcedeth: Do not use legacy PCI power management (diff) | |
download | linux-0ab03c2b1478f2438d2c80204f7fef65b1bca9cf.tar.xz linux-0ab03c2b1478f2438d2c80204f7fef65b1bca9cf.zip |
netlink: test for all flags of the NLM_F_DUMP composite
Due to NLM_F_DUMP is composed of two bits, NLM_F_ROOT | NLM_F_MATCH,
when doing "if (x & NLM_F_DUMP)", it tests for _either_ of the bits
being set. Because NLM_F_MATCH's value overlaps with NLM_F_EXCL,
non-dump requests with NLM_F_EXCL set are mistaken as dump requests.
Substitute the condition to test for _all_ bits being set.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_diag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 2ada17129fce..2746c1fa6417 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -858,7 +858,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) nlmsg_len(nlh) < hdrlen) return -EINVAL; - if (nlh->nlmsg_flags & NLM_F_DUMP) { + if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { if (nlmsg_attrlen(nlh, hdrlen)) { struct nlattr *attr; |