FST: Fix get_peer_mbies interface fetching in multi-group case

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>
This commit is contained in:
Jouni Malinen 2015-07-26 16:28:51 +03:00
parent 1ab51fb595
commit f4843c2645

View file

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