when you connect to an open wifi, your laptop (or whatever) ask for permission, the router will give the permission and hands you a name tag, the ip (no trickery or hacking involved). It is not a passive process, like, say, entering an unlocked home, in which the house is passively exploited.