aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-01-06 22:15:05 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-09 19:25:03 -0500
commit0ab03c2b1478f2438d2c80204f7fef65b1bca9cf (patch)
treea130abc7a3cc2d5c326b1bbdad80c06e741db3fd /net/core/rtnetlink.c
parentdba5a68ae147d0672d4b9259f3ece37777f8b2fa (diff)
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/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 750db57f3bb3..a5f7535aab5b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1820,7 +1820,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
1820 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) 1820 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN))
1821 return -EPERM; 1821 return -EPERM;
1822 1822
1823 if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { 1823 if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
1824 struct sock *rtnl; 1824 struct sock *rtnl;
1825 rtnl_dumpit_func dumpit; 1825 rtnl_dumpit_func dumpit;
1826 1826