team: replicate options on register
Since multiple team instances are putting defined options into their
option list, during register each option must be cloned before added
into list. This resolves uncool memory corruptions when using multiple
teams.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index a6eac12..828181f 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -140,11 +140,11 @@
}
extern int team_port_set_team_mac(struct team_port *port);
-extern void team_options_register(struct team *team,
- struct team_option *option,
- size_t option_count);
+extern int team_options_register(struct team *team,
+ const struct team_option *option,
+ size_t option_count);
extern void team_options_unregister(struct team *team,
- struct team_option *option,
+ const struct team_option *option,
size_t option_count);
extern int team_mode_register(struct team_mode *mode);
extern int team_mode_unregister(struct team_mode *mode);