Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: fix netlink address dumping in IPv4/IPv6

When a dump is interrupted at the last device in a hash chain and
then continued, "idx" won't get incremented past s_idx, so s_ip_idx
is not reset when moving on to the next device. This means of all
following devices only the last n - s_ip_idx addresses are dumped.

Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Patrick McHardy and committed by
David S. Miller
4b97efdf ac90a149

+2 -2
+1 -1
net/ipv4/devinet.c
··· 1194 1194 hlist_for_each_entry_rcu(dev, node, head, index_hlist) { 1195 1195 if (idx < s_idx) 1196 1196 goto cont; 1197 - if (idx > s_idx) 1197 + if (h > s_h || idx > s_idx) 1198 1198 s_ip_idx = 0; 1199 1199 in_dev = __in_dev_get_rcu(dev); 1200 1200 if (!in_dev)
+1 -1
net/ipv6/addrconf.c
··· 3610 3610 hlist_for_each_entry_rcu(dev, node, head, index_hlist) { 3611 3611 if (idx < s_idx) 3612 3612 goto cont; 3613 - if (idx > s_idx) 3613 + if (h > s_h || idx > s_idx) 3614 3614 s_ip_idx = 0; 3615 3615 ip_idx = 0; 3616 3616 if ((idev = __in6_dev_get(dev)) == NULL)