The name of this function is funny because there's nothing about vlans below (it just so happens that the network_id passed it is using vlan segmentation and has been assigned a vlan id). I'd change vlan->network (same for the unplug_host method below).