diff options
author | Zheng Da <zhengda1936@gmail.com> | 2010-07-31 07:33:10 +0200 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2010-07-31 07:33:10 +0200 |
commit | 4f7cf90e6c8446f28c621bc9134438e41403e297 (patch) | |
tree | 35cbaa83380e123224e12d13de7fc7eae078b090 /eth-multiplexer/vdev.c | |
parent | 984ad35cf434936fdf6ca11e685324bc8edf62cc (diff) |
Use libbpf in eth-multiplxer.
Diffstat (limited to 'eth-multiplexer/vdev.c')
-rw-r--r-- | eth-multiplexer/vdev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/eth-multiplexer/vdev.c b/eth-multiplexer/vdev.c index 5e525b31..29e2b4b1 100644 --- a/eth-multiplexer/vdev.c +++ b/eth-multiplexer/vdev.c @@ -112,8 +112,10 @@ remove_dead_port_from_dev (mach_port_t dead_port) mutex_lock (&dev_list_lock); for (vdev = dev_head; vdev; vdev = vdev->next) { - remove_dead_filter (vdev, &vdev->if_rcv_port_list, dead_port); - remove_dead_filter (vdev, &vdev->if_snd_port_list, dead_port); + remove_dead_filter (&vdev->port_list, + &vdev->port_list.if_rcv_port_list, dead_port); + remove_dead_filter (&vdev->port_list, + &vdev->port_list.if_snd_port_list, dead_port); } mutex_unlock (&dev_list_lock); return 0; @@ -145,8 +147,8 @@ add_vdev (char *name, int size, vdev->if_address[1] = 0x54; *(int *)(vdev->if_address + 2) = random (); - queue_init (&vdev->if_rcv_port_list); - queue_init (&vdev->if_snd_port_list); + queue_init (&vdev->port_list.if_rcv_port_list); + queue_init (&vdev->port_list.if_snd_port_list); mutex_lock (&dev_list_lock); vdev->next = dev_head; @@ -177,7 +179,7 @@ destroy_vdev (void *port) /* TODO Delete all filters in the interface, * there shouldn't be any filters left */ - destroy_filters (vdev); + destroy_filters (&vdev->port_list); } /* Test if there are devices existing in the list */ @@ -265,7 +267,7 @@ deliver_msg(struct net_rcv_msg *msg, struct vether_device *vdev) msg->msg_hdr.msgh_kind = MACH_MSGH_KIND_NORMAL; msg->msg_hdr.msgh_id = NET_RCV_MSG_ID; - if_port_list = &vdev->if_rcv_port_list; + if_port_list = &vdev->port_list.if_rcv_port_list; FILTER_ITERATE (if_port_list, infp, nextfp, &infp->input) { mach_port_t dest; |