- Timestamp:
- May 12, 2009 10:54:38 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r19571 r19604 1410 1410 } 1411 1411 1412 #if 0 1413 /** 1414 * Set the DLPI style-2 PPA via an attach request .1415 * Currently unused; dl_attach is used instead.1412 1413 /** 1414 * Set the DLPI style-2 PPA via an attach request, Synchronous. 1415 * Waits for request acknowledgement and verifies the result. 1416 1416 * 1417 1417 * @returns VBox status code. … … 1422 1422 { 1423 1423 int rc; 1424 t_uscalar_t Cmd = DL_ATTACH_REQ; 1425 size_t cbReq = DL_ATTACH_REQ_SIZE; 1426 mblk_t *pAttachMsg = mexchange(NULL, NULL, cbReq, M_PROTO, Cmd); 1424 mblk_t *pAttachMsg = mexchange(NULL, NULL, DL_ATTACH_REQ_SIZE, M_PROTO, DL_ATTACH_REQ); 1427 1425 if (RT_UNLIKELY(!pAttachMsg)) 1428 1426 return VERR_NO_MEMORY; … … 1436 1434 rc = ldi_getmsg(hDevice, &pAttachMsg, NULL); 1437 1435 if (!rc) 1438 return VINF_SUCCESS; 1436 { 1437 /* 1438 * Verify if the attach succeeded. 1439 */ 1440 size_t cbMsg = MBLKL(pAttachMsg); 1441 if (cbMsg >= sizeof(t_uscalar_t)) 1442 { 1443 union DL_primitives *pPrim = (union DL_primitives *)pAttachMsg->b_rptr; 1444 t_uscalar_t AckPrim = pPrim->dl_primitive; 1445 1446 if ( AckPrim == DL_OK_ACK /* Success! */ 1447 && cbMsg == DL_OK_ACK_SIZE) 1448 { 1449 rc = VINF_SUCCESS; 1450 } 1451 else if ( AckPrim == DL_ERROR_ACK /* Error Ack. */ 1452 && cbMsg == DL_ERROR_ACK_SIZE) 1453 { 1454 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachReq ldi_getmsg succeeded, but unsupported op.\n")); 1455 rc = VERR_NOT_SUPPORTED; 1456 } 1457 else /* Garbled reply */ 1458 { 1459 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachReq ldi_getmsg succeeded, but invalid op. expected %s recvd %s\n", 1460 dl_primstr(DL_OK_ACK), dl_primstr(AckPrim))); 1461 rc = VERR_INVALID_FUNCTION; 1462 } 1463 } 1464 else 1465 { 1466 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachReq ldi_getmsg succeeded, but invalid size %d expected %d\n", cbMsg, 1467 DL_OK_ACK_SIZE)); 1468 rc = VERR_INVALID_FUNCTION; 1469 } 1470 } 1439 1471 else 1472 { 1440 1473 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachReq ldi_getmsg failed. rc=%d\n", rc)); 1474 rc = VERR_INVALID_FUNCTION; 1475 } 1441 1476 } 1442 1477 else 1478 { 1443 1479 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachReq ldi_putmsg failed. rc=%d\n", rc)); 1444 1445 return VERR_GENERAL_FAILURE; 1446 } 1447 #endif 1480 rc = VERR_UNRESOLVED_ERROR; 1481 } 1482 1483 freemsg(pAttachMsg); 1484 return rc; 1485 } 1448 1486 1449 1487 … … 1708 1746 * Attach the PPA explictly. 1709 1747 */ 1710 rc = dl_attach(pThis->u.s.hIface, (int)PPA, NULL);1711 if ( !rc)1748 rc = vboxNetFltSolarisAttachReq(pThis->u.s.hIface, (int)PPA); 1749 if (RT_SUCCESS(rc)) 1712 1750 { 1713 1751 RTStrFree(pszDev); 1714 return VINF_SUCCESS;1752 return rc; 1715 1753 } 1716 1754
Note:
See TracChangeset
for help on using the changeset viewer.