Changeset 12123 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Sep 5, 2008 11:05:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r12089 r12123 520 520 static int VBoxNetFltSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pvArg, void **ppResult) 521 521 { 522 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisGetInfo pDip=%p enmCmd=%d pArg=%p instance=%d\n", pDip, enmCmd, getminor((dev_t)pvArg))); 522 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisGetInfo pDip=%p enmCmd=%d pArg=%p instance=%d\n", pDip, enmCmd, 523 getminor((dev_t)pvArg))); 523 524 524 525 switch (enmCmd) … … 557 558 Assert(pQueue); 558 559 559 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen pQueue=%p pDev=%p fOpenMode=%d fStreamMode=%d\n", pQueue, pDev, fOpenMode, fStreamMode)); 560 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen pQueue=%p pDev=%p fOpenMode=%d fStreamMode=%d\n", pQueue, pDev, 561 fOpenMode, fStreamMode)); 560 562 561 563 /* … … 638 640 WR(pQueue)->q_ptr = pStream; 639 641 640 /** @todo Get rid of linked list maintenance; we're not a virtual DLPI device slaving for ring-3 consumers. */641 642 /* 642 643 * Link it to the list of streams. … … 985 986 * Since we are evil, let's acknowledge the request ourselves! 986 987 */ 987 mioc nak(pQueue, pMsg, 0, EINVAL);988 miocack(pQueue, pMsg, 0, EINVAL); 988 989 fSendDownstream = false; 989 990 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Fast path request when we need raw mode!\n")); … … 1251 1252 bcopy(pMsg->b_rptr + pPhysAddrAck->dl_addr_offset, &pThis->u.s.Mac, sizeof(pThis->u.s.Mac)); 1252 1253 1253 LogFlow((DEVICE_NAME ":vboxNetFltSolarisCachePhysAddr: DL_PHYS_ADDR_ACK: Mac=%.*Rhxs\n", sizeof(pThis->u.s.Mac), &pThis->u.s.Mac)); 1254 LogFlow((DEVICE_NAME ":vboxNetFltSolarisCachePhysAddr: DL_PHYS_ADDR_ACK: Mac=%.*Rhxs\n", sizeof(pThis->u.s.Mac), 1255 &pThis->u.s.Mac)); 1254 1256 } 1255 1257 } … … 1382 1384 static int vboxNetFltSolarisRelink(vnode_t *pVNode, struct lifreq *pInterface, int IpMuxFd, int ArpMuxFd) 1383 1385 { 1384 LogFlow((DEVICE_NAME ":vboxNetFltSolarisRelink: pVNode=%p pInterface=%p IpMuxFd=%d ArpMuxFd=%d\n", pVNode, pInterface, IpMuxFd, ArpMuxFd)); 1386 LogFlow((DEVICE_NAME ":vboxNetFltSolarisRelink: pVNode=%p pInterface=%p IpMuxFd=%d ArpMuxFd=%d\n", pVNode, 1387 pInterface, IpMuxFd, ArpMuxFd)); 1385 1388 1386 1389 int NewIpMuxId; … … 1623 1626 * Inject/Eject from the host IP stack. 1624 1627 */ 1625 rc = strioctl(pVNodeIp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K, kcred, &ret); 1628 rc = strioctl(pVNodeIp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K, 1629 kcred, &ret); 1626 1630 if (!rc) 1627 1631 { … … 1630 1634 */ 1631 1635 g_VBoxNetFltSolarisState.CurType = kArpStream; 1632 rc = strioctl(pVNodeArp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&ArpStrMod, 0, K_TO_K, kcred, &ret); 1636 rc = strioctl(pVNodeArp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&ArpStrMod, 0, K_TO_K, 1637 kcred, &ret); 1633 1638 if (!rc) 1634 1639 { … … 1643 1648 if (VBOX_SUCCESS(rc)) 1644 1649 { 1645 bool fRawModeOk = !fAttach; 1650 bool fRawModeOk = !fAttach; /* Raw mode check is always ok during the detach case */ 1646 1651 if (fAttach) 1647 1652 { … … 1671 1676 ldi_close(IPDevHandle, FREAD | FWRITE, kcred); 1672 1677 1673 LogFlow((DEVICE_NAME ":vboxNetFltSolarisModSetup: Success! %s %s@(Ip:%d Arp:%d) %s interface %s\n",1674 fAttach ? "Injected" : "Ejected", StrMod.mod_name, StrMod.pos, ArpStrMod.pos,1675 fAttach ? "to" : "from", pThis->szName));1678 LogFlow((DEVICE_NAME ":vboxNetFltSolarisModSetup: Success! %s %s@(Ip:%d Arp:%d) " 1679 "%s interface %s\n", fAttach ? "Injected" : "Ejected", StrMod.mod_name, 1680 StrMod.pos, ArpStrMod.pos, fAttach ? "to" : "from", pThis->szName)); 1676 1681 return VINF_SUCCESS; 1677 1682 } … … 1681 1686 else 1682 1687 { 1683 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: module relinking failed. Mode=%s rc=%d.\n",1688 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: Relinking failed. Mode=%s rc=%d.\n", 1684 1689 fAttach ? "inject" : "eject", rc)); 1685 1690 } … … 1709 1714 } 1710 1715 else 1711 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: vboxNetFltSolarisDetermineModPos failed. rc=%d rc2=%d\n", rc, rc2));1716 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: failed to find position. rc=%d rc2=%d\n", rc, rc2)); 1712 1717 } 1713 1718 else … … 2099 2104 2100 2105 bool fChecksumAdjusted = false; 2101 #if 02106 #if 1 2102 2107 if (fSrc & INTNETTRUNKDIR_HOST) 2103 2108 { … … 2200 2205 * This must not be DLPI linked messages, must be M_DATA. 2201 2206 * 2202 * @remarks This function expects raw mblk_t (chained is acceptible) and if it2203 * returns a corrected message, the passed in input message has been2204 * freed and should not be referenced anymore.2207 * @remarks If this function returns a checksum adjusted message, the 2208 * passed in input message has been freed and should not be 2209 * referenced anymore by the caller. 2205 2210 */ 2206 2211 static mblk_t *vboxNetFltSolarisFixChecksums(mblk_t *pMsg) … … 2223 2228 */ 2224 2229 size_t cbIpPacket = 0; 2230 mblk_t *pFullMsg = NULL; 2225 2231 if (pMsg->b_cont) 2226 2232 { … … 2252 2258 } 2253 2259 2254 freemsg(pMsg); 2255 pMsg = pFullMsg; 2256 DB_TYPE(pMsg) = M_DATA; 2257 pEthHdr = (PRTNETETHERHDR)pMsg->b_rptr; 2258 } 2259 2260 cbIpPacket = MBLKL(pMsg) - sizeof(RTNETETHERHDR); 2260 DB_TYPE(pFullMsg) = M_DATA; 2261 pEthHdr = (PRTNETETHERHDR)pFullMsg->b_rptr; 2262 cbIpPacket = MBLKL(pFullMsg) - sizeof(RTNETETHERHDR); 2263 } 2264 else 2265 cbIpPacket = MBLKL(pMsg) - sizeof(RTNETETHERHDR); 2261 2266 2262 2267 /* … … 2301 2306 LogFlow((DEVICE_NAME ":fixed IP checkum.\n")); 2302 2307 2308 /* 2309 * If we made a copy and the checksum is corrected on the copy, 2310 * free the original, return the checksum fixed copy. 2311 */ 2312 if (pFullMsg) 2313 { 2314 freemsg(pMsg); 2315 return pFullMsg; 2316 } 2317 2303 2318 return pMsg; 2304 2319 } 2320 2321 /* 2322 * If we made a copy and the checksum is NOT corrected, free the copy, 2323 * and return NULL. 2324 */ 2325 if (pFullMsg) 2326 freemsg(pFullMsg); 2305 2327 } 2306 2328 … … 2341 2363 else 2342 2364 { 2343 LogFlow((DEVICE_NAME ":Unknown EtherType=%x D=%.6Rhxs S=%.6Rhxs\n", RT_H2BE_U16(pEthHdr->EtherType), &pEthHdr->DstMac, &pEthHdr->SrcMac)); 2365 LogFlow((DEVICE_NAME ":Unknown EtherType=%x D=%.6Rhxs S=%.6Rhxs\n", RT_H2BE_U16(pEthHdr->EtherType), &pEthHdr->DstMac, 2366 &pEthHdr->SrcMac)); 2344 2367 /* LogFlow((DEVICE_NAME ":%.*Vhxd\n", MBLKL(pMsg), pMsg->b_rptr)); */ 2345 2368 }
Note:
See TracChangeset
for help on using the changeset viewer.