ETHER,VAX,PDP11: Fixed regression in pcap ethernet link behavior introduced by the addition of the udp link type. This fixes issue #92
This commit is contained in:
parent
25a62c2837
commit
e34babdc7e
1 changed files with 4 additions and 3 deletions
|
@ -1515,7 +1515,7 @@ pthread_getschedparam (pthread_self(), &sched_policy, &sched_priority);
|
||||||
++sched_priority.sched_priority;
|
++sched_priority.sched_priority;
|
||||||
pthread_setschedparam (pthread_self(), sched_policy, &sched_priority);
|
pthread_setschedparam (pthread_self(), sched_policy, &sched_priority);
|
||||||
|
|
||||||
while (dev->fd_handle) {
|
while (dev->handle) {
|
||||||
#if defined (_WIN32)
|
#if defined (_WIN32)
|
||||||
if (dev->eth_api == ETH_API_PCAP) {
|
if (dev->eth_api == ETH_API_PCAP) {
|
||||||
if (WAIT_OBJECT_0 == WaitForSingleObject (hWait, 250))
|
if (WAIT_OBJECT_0 == WaitForSingleObject (hWait, 250))
|
||||||
|
@ -1539,7 +1539,7 @@ while (dev->fd_handle) {
|
||||||
if (sel_ret < 0 && errno != EINTR) break;
|
if (sel_ret < 0 && errno != EINTR) break;
|
||||||
}
|
}
|
||||||
if (sel_ret > 0) {
|
if (sel_ret > 0) {
|
||||||
if (!dev->fd_handle)
|
if (!dev->handle)
|
||||||
break;
|
break;
|
||||||
/* dispatch read request queue available packets */
|
/* dispatch read request queue available packets */
|
||||||
switch (dev->eth_api) {
|
switch (dev->eth_api) {
|
||||||
|
@ -1638,7 +1638,7 @@ pthread_setschedparam (pthread_self(), sched_policy, &sched_priority);
|
||||||
sim_debug(dev->dbit, dev->dptr, "Writer Thread Starting\n");
|
sim_debug(dev->dbit, dev->dptr, "Writer Thread Starting\n");
|
||||||
|
|
||||||
pthread_mutex_lock (&dev->writer_lock);
|
pthread_mutex_lock (&dev->writer_lock);
|
||||||
while (dev->fd_handle) {
|
while (dev->handle) {
|
||||||
pthread_cond_wait (&dev->writer_cond, &dev->writer_lock);
|
pthread_cond_wait (&dev->writer_cond, &dev->writer_lock);
|
||||||
while (NULL != (request = dev->write_requests)) {
|
while (NULL != (request = dev->write_requests)) {
|
||||||
/* Pull buffer off request list */
|
/* Pull buffer off request list */
|
||||||
|
@ -1872,6 +1872,7 @@ else
|
||||||
if (INVALID_SOCKET == dev->fd_handle)
|
if (INVALID_SOCKET == dev->fd_handle)
|
||||||
return SCPE_OPENERR;
|
return SCPE_OPENERR;
|
||||||
dev->eth_api = ETH_API_UDP;
|
dev->eth_api = ETH_API_UDP;
|
||||||
|
dev->handle = (void *)1; /* Flag used to indicated open */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dev->handle = (void*) pcap_open_live(savname, bufsz, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
|
dev->handle = (void*) pcap_open_live(savname, bufsz, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue