{
USBNetState *s = (USBNetState *) dev;
- /* FIXME: delete the VLAN client and the nic */
+ /* TODO: remove the nd_table[] entry */
+ qemu_del_vlan_client(s->vc);
rndis_clear_responsequeue(s);
qemu_free(s);
}
IOReadHandler *fd_read,
IOCanRWHandler *fd_can_read,
void *opaque);
+void qemu_del_vlan_client(VLANClientState *vc);
int qemu_can_send_packet(VLANClientState *vc);
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
void qemu_handler_true(void *opaque);
return vc;
}
+void qemu_del_vlan_client(VLANClientState *vc)
+{
+ VLANClientState **pvc = &vc->vlan->first_client;
+
+ while (*pvc != NULL)
+ if (*pvc == vc) {
+ *pvc = vc->next;
+ free(vc);
+ break;
+ } else
+ pvc = &(*pvc)->next;
+}
+
int qemu_can_send_packet(VLANClientState *vc1)
{
VLANState *vlan = vc1->vlan;