Changeset 35785 in vbox for trunk/src/VBox/HostDrivers/VBoxNetAdp/linux
- Timestamp:
- Jan 31, 2011 12:45:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
r33540 r35785 176 176 177 177 178 int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress )178 int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress, const char *pcszName) 179 179 { 180 180 int rc = VINF_SUCCESS; … … 182 182 183 183 /* No need for private data. */ 184 pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), VBOXNETADP_LINUX_NAME, vboxNetAdpNetDevInit); 184 pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), 185 pcszName ? pcszName : VBOXNETADP_LINUX_NAME, 186 vboxNetAdpNetDevInit); 185 187 if (pNetDev) 186 188 { … … 277 279 PVBOXNETADP pAdp; 278 280 int rc; 281 char *pszName = NULL; 279 282 280 283 Log(("VBoxNetAdpLinuxIOCtl: param len %#x; uCmd=%#x; add=%#x\n", _IOC_SIZE(uCmd), uCmd, VBOXNETADP_CTL_ADD)); … … 289 292 case VBOXNETADP_CTL_ADD: 290 293 Log(("VBoxNetAdpLinuxIOCtl: _IOC_DIR(uCmd)=%#x; IOC_OUT=%#x\n", _IOC_DIR(uCmd), IOC_OUT)); 291 rc = vboxNetAdpCreate(&pAdp); 294 if (RT_UNLIKELY(copy_from_user(&Req, (void *)ulArg, sizeof(Req)))) 295 { 296 Log(("VBoxNetAdpLinuxIOCtl: copy_from_user(,%#lx,) failed; uCmd=%#x.\n", ulArg, uCmd)); 297 return -EFAULT; 298 } 299 Log(("VBoxNetAdpLinuxIOCtl: Add %s\n", Req.szName)); 300 301 if (Req.szName[0]) 302 { 303 pAdp = vboxNetAdpFindByName(Req.szName); 304 if (pAdp) 305 { 306 Log(("VBoxNetAdpLinuxIOCtl: '%s' already exists\n", Req.szName)); 307 return -EINVAL; 308 } 309 pszName = Req.szName; 310 } 311 rc = vboxNetAdpCreate(&pAdp, pszName); 292 312 if (RT_FAILURE(rc)) 293 313 {
Note:
See TracChangeset
for help on using the changeset viewer.