diff options
author | Ken-ichirou MATSUZAWA <chamaken@gmail.com> | 2015-08-28 10:05:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-29 08:25:42 +0300 |
commit | 7084a315897715776d1764f5fd9250609e515beb (patch) | |
tree | 463dba9a70f3fa0df25bf01b4c9c224779242ced /net/netlink | |
parent | 0a6a3a23ea6efde079a5b77688541a98bf202721 (diff) | |
download | linux-7084a315897715776d1764f5fd9250609e515beb.tar.xz |
netlink: mmap: fix lookup frame position
__netlink_lookup_frame() was always called with the same "pos"
value in netlink_forward_ring(). It will look at the same ring entry
header over and over again, every time through this loop. Then cycle
through the whole ring, advancing ring->head, not "pos" until it
equals the "ring->head != head" loop test fails.
Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 3eea0b2a3239..7965ca7c461d 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -611,11 +611,11 @@ static void netlink_increment_head(struct netlink_ring *ring) static void netlink_forward_ring(struct netlink_ring *ring) { - unsigned int head = ring->head, pos = head; + unsigned int head = ring->head; const struct nl_mmap_hdr *hdr; do { - hdr = __netlink_lookup_frame(ring, pos); + hdr = __netlink_lookup_frame(ring, ring->head); if (hdr->nm_status == NL_MMAP_STATUS_UNUSED) break; if (hdr->nm_status != NL_MMAP_STATUS_SKIP) |