lwip_socket_drop_registered_mld6_memberships: Fix if_idx got lost :-(

This commit is contained in:
Dirk Ziegelmeier 2017-08-21 09:46:08 +02:00
parent 6082251854
commit fa51a7225a

View File

@ -3693,12 +3693,16 @@ lwip_socket_drop_registered_mld6_memberships(int s)
for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) {
if (socket_ipv6_multicast_memberships[i].sock == sock) {
ip_addr_t multi_addr;
u8_t if_idx;
ip_addr_copy_from_ip6(multi_addr, socket_ipv6_multicast_memberships[i].multi_addr);
if_idx = socket_ipv6_multicast_memberships[i].if_idx;
socket_ipv6_multicast_memberships[i].sock = NULL;
socket_ipv6_multicast_memberships[i].if_idx = NETIF_NO_INDEX;
ip6_addr_set_zero(&socket_ipv6_multicast_memberships[i].multi_addr);
netconn_join_leave_group_netif(sock->conn, &multi_addr, socket_ipv6_multicast_memberships[i].if_idx, NETCONN_LEAVE);
netconn_join_leave_group_netif(sock->conn, &multi_addr, if_idx, NETCONN_LEAVE);
}
}
done_socket(sock);