While the protocol described in Section 5.2 works for multiple cards switching between infrastructure networks, it has to be enhanced to handle multiple cards switching in and out of an ad hoc network. We first describe the scenario in infrastructure and ad hoc networks, and then present a distributed algorithm to solve the problem.