Skip to content

Commit 3f3e7ce

Browse files
jpirkodavem330
authored andcommitted
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 d90f889 (team: handle sending port list in the same way option list is sent) Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6d7581e commit 3f3e7ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/team/team.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
23742374
bool incomplete;
23752375
int i;
23762376

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);
23782379

23792380
start_again:
23802381
err = __send_and_alloc_skb(&skb, team, portid, send_func);
@@ -2402,8 +2403,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
24022403
err = team_nl_fill_one_port_get(skb, one_port);
24032404
if (err)
24042405
goto errout;
2405-
} else {
2406-
list_for_each_entry(port, &team->port_list, list) {
2406+
} else if (port) {
2407+
list_for_each_entry_from(port, &team->port_list, list) {
24072408
err = team_nl_fill_one_port_get(skb, port);
24082409
if (err) {
24092410
if (err == -EMSGSIZE) {

0 commit comments

Comments
 (0)