[PATCHv2] libteam: do not destroy the ifinfo of current unregistered slave dev
diff mbox

Message ID CY1PR14MB020327C39F4979D22B163865B5830@CY1PR14MB0203.namprd14.prod.outlook.com
State New
Headers show

Commit Message

Tiainen, Antti April 29, 2018, 12:28 p.m. UTC
I sent my suggestion how to fix this. I don't have any objections to

Xin Long's patch either, so maybe mr. Pirko you decide how we handle

this. I can see that this is reported in Red Hat Bugzilla, so it's important

that the crash is fixed now some way.


-antti

Patch
diff mbox

diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c
index 5c32a9c..d47c2bf 100644
--- a/libteam/ifinfo.c
+++ b/libteam/ifinfo.c
@@ -211,7 +211,8 @@  void ifinfo_clear_changed(struct team_handle *th)
         struct team_ifinfo *ifinfo;

         list_for_each_node_entry(ifinfo, &th->ifinfo_list, list)
-               clear_changed(ifinfo);
+               if (!ifinfo->port)
+                       clear_changed(ifinfo);
 }

 static struct team_ifinfo *ifinfo_find_create(struct team_handle *th,
@@ -245,7 +246,7 @@  void ifinfo_destroy_removed(struct team_handle *th)
         struct team_ifinfo *ifinfo, *tmp;

         list_for_each_node_entry_safe(ifinfo, tmp, &th->ifinfo_list, list) {
-               if (is_changed(ifinfo, CHANGED_REMOVED))
+               if (is_changed(ifinfo, CHANGED_REMOVED) && !ifinfo->port)
                         ifinfo_destroy(ifinfo);
         }
 }