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

ipmr_base: Do not reset index in mr_table_dump

e is the counter used to save the location of a dump when an
skb is filled. Once the walk of the table is complete, mr_table_dump
needs to return without resetting that index to 0. Dump of a specific
table is looping because of the reset because there is no way to
indicate the walk of the table is done.

Move the reset to the caller so the dump of each table starts at 0,
but the loop counter is maintained if a dump fills an skb.

Fixes: e1cedae1ba6b0 ("ipmr: Refactor mr_rtm_dumproute")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
7fcd1e03 25426043

+1 -2
+1 -2
net/ipv4/ipmr_base.c
··· 335 335 } 336 336 spin_unlock_bh(lock); 337 337 err = 0; 338 - e = 0; 339 - 340 338 out: 341 339 cb->args[1] = e; 342 340 return err; ··· 372 374 err = mr_table_dump(mrt, skb, cb, fill, lock, filter); 373 375 if (err < 0) 374 376 break; 377 + cb->args[1] = 0; 375 378 next_table: 376 379 t++; 377 380 }