From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net/ipv6: Fix index counter for unicast addresses in in6_dump_addrs Date: Sat, 20 Oct 2018 15:44:09 -0700 (PDT) Message-ID: <20181020.154409.2031684747234961796.davem@davemloft.net> References: <20181019170019.670-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, stephen@networkplumber.org, dsahern@gmail.com To: dsahern@kernel.org Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:36066 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbeJUG4Q (ORCPT ); Sun, 21 Oct 2018 02:56:16 -0400 In-Reply-To: <20181019170019.670-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern Date: Fri, 19 Oct 2018 10:00:19 -0700 > From: David Ahern > > The loop wants to skip previously dumped addresses, so loops until > current index >= saved index. If the message fills it wants to save > the index for the next address to dump - ie., the one that did not > fit in the current message. > > Currently, it is incrementing the index counter before comparing to the > saved index, and then the saved index is off by 1 - it assumes the > current address is going to fit in the message. > > Change the index handling to increment only after a succesful dump. > > Fixes: 502a2ffd7376a ("ipv6: convert idev_list to list macros") > Signed-off-by: David Ahern Applied and queued up for -stable, thanks David.