When not using MLD I would suggest the following:
//this is your code
else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) {
//suggestion starts here
for(netif = netif_list; netif != NULL; netif = netif->next) {
for (i = 0; i< LWIP_IPV6_NUM_ADDRESSES; i++) {
if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))&&
ip6_addr_match_solicitednode(current_src_addr(),
netif_ip6_addr(netif, i))) {
LWIP_DEBUGF(IP6_ELE_DEBUG, ("solicited node mcast
addr\r\n"));
netif = inp;
break;
}
}
}
}
I've pushed a solution to this, it is based on your suggestion, but it
only checks on receiving netif, as solicited node addresses are link-local
so it makes no sense to check other netifs.