FST: Fix get_peer_mbies interface fetching in multi-group case
authorJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 13:28:51 +0000 (16:28 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 15:45:13 +0000 (18:45 +0300)
The foreach_fst_group() loop needs "break-if-found", not
"continue-if-not-found" to do the search iteration properly. If there
were multiple groups, the previous design could have failed to find the
interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/fst/fst_ctrl_iface.c

index 76d4776..d090718 100644 (file)
@@ -574,8 +574,8 @@ static int get_peer_mbies(const char *params, char *buf, size_t buflen)
 
        foreach_fst_group(g) {
                iface = fst_group_get_iface_by_name(g, ifname);
-               if (!iface)
-                       continue;
+               if (iface)
+                       break;
        }
        if (!iface)
                goto problem;