aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/team/team.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-05-29 01:02:57 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-31 20:31:52 -0400
commit3f3e7ce4ff87c8ea69acaa7700699fb26baa2914 (patch)
tree090b634d4e01b42c3d4aa0f7e74229487d0cb3a2 /drivers/net/team/team.c
parent6d7581e62f8be462440d7b22c6361f7c9fa4902b (diff)
team: fix port list dump for big number of ports
In case the port list dump does not fit into one skb currently the dump would start over again. Fix this by continue from the last dumped port. Introduced by commit d90f889e9c (team: handle sending port list in the same way option list is sent) Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team/team.c')
-rw-r--r--drivers/net/team/team.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 7c43261975bd..d016a76ad44b 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2374,7 +2374,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
2374 bool incomplete; 2374 bool incomplete;
2375 int i; 2375 int i;
2376 2376
2377 port = list_first_entry(&team->port_list, struct team_port, list); 2377 port = list_first_entry_or_null(&team->port_list,
2378 struct team_port, list);
2378 2379
2379start_again: 2380start_again:
2380 err = __send_and_alloc_skb(&skb, team, portid, send_func); 2381 err = __send_and_alloc_skb(&skb, team, portid, send_func);
@@ -2402,8 +2403,8 @@ start_again:
2402 err = team_nl_fill_one_port_get(skb, one_port); 2403 err = team_nl_fill_one_port_get(skb, one_port);
2403 if (err) 2404 if (err)
2404 goto errout; 2405 goto errout;
2405 } else { 2406 } else if (port) {
2406 list_for_each_entry(port, &team->port_list, list) { 2407 list_for_each_entry_from(port, &team->port_list, list) {
2407 err = team_nl_fill_one_port_get(skb, port); 2408 err = team_nl_fill_one_port_get(skb, port);
2408 if (err) { 2409 if (err) {
2409 if (err == -EMSGSIZE) { 2410 if (err == -EMSGSIZE) {