Changeset 36385 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt
- Timestamp:
- Mar 24, 2011 6:15:17 AM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
r36121 r36385 425 425 $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ 426 426 | $$(dir $$@) 427 $(QUIET)$(CP) -f $< $@ 427 428 ifndef VBOX_WITH_HARDENING 428 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< 429 else 430 $(QUIET)$(CP) -f $< $@ 429 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output [email protected] $@ 430 ${QUIET}$(MV) -f [email protected] $@ 431 endif 432 ifndef VBOX_WITH_NETFLT_VIMAGE 433 $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output [email protected] $@ 434 ${QUIET}$(MV) -f [email protected] $@ 431 435 endif 432 436 endif # freebsd -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile
r28800 r36385 19 19 KMOD = vboxnetflt 20 20 21 CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING 21 CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE 22 22 23 23 .if (${MACHINE_ARCH} == "i386") -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r30111 r36385 98 98 #define PACKET_TAG_VBOX 128 99 99 100 #if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 101 # include <sys/jail.h> 102 # include <net/vnet.h> 103 104 # define VBOXCURVNET_SET(arg) CURVNET_SET_QUIET(arg) 105 # define VBOXCURVNET_SET_FROM_UCRED() VBOXCURVNET_SET(CRED_TO_VNET(curthread->td_ucred)) 106 # define VBOXCURVNET_RESTORE() CURVNET_RESTORE() 107 108 #else /* !defined(__FreeBSD_version) || __FreeBSD_version < 800500 */ 109 110 # define VBOXCURVNET_SET(arg) 111 # define VBOXCURVNET_SET_FROM_UCRED() 112 # define VBOXCURVNET_RESTORE() 113 114 #endif /* !defined(__FreeBSD_version) || __FreeBSD_version < 800500 */ 115 100 116 /* 101 117 * Netgraph command list, we don't support any … … 323 339 bool fActive; 324 340 341 VBOXCURVNET_SET(ifp->if_vnet); 325 342 fActive = vboxNetFltTryRetainBusyActive(pThis); 326 343 … … 347 364 if (fActive) 348 365 vboxNetFltRelease(pThis, true /*fBusy*/); 366 VBOXCURVNET_RESTORE(); 349 367 return (0); 350 368 } … … 364 382 if (fActive) 365 383 vboxNetFltRelease(pThis, true /*fBusy*/); 384 VBOXCURVNET_RESTORE(); 366 385 return rc; 367 386 } … … 378 397 if (fActive) 379 398 vboxNetFltRelease(pThis, true /*fBusy*/); 399 VBOXCURVNET_RESTORE(); 380 400 return (0); 381 401 } … … 410 430 PINTNETSG pSG; 411 431 432 VBOXCURVNET_SET(ifp->if_vnet); 412 433 vboxNetFltRetain(pThis, true /* fBusy */); 413 434 for (;;) … … 439 460 } 440 461 vboxNetFltRelease(pThis, true /* fBusy */); 462 VBOXCURVNET_RESTORE(); 441 463 } 442 464 … … 453 475 PINTNETSG pSG; 454 476 477 VBOXCURVNET_SET(ifp->if_vnet); 455 478 vboxNetFltRetain(pThis, true /* fBusy */); 456 479 for (;;) … … 482 505 } 483 506 vboxNetFltRelease(pThis, true /* fBusy */); 507 VBOXCURVNET_RESTORE(); 484 508 } 485 509 … … 499 523 500 524 ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); 525 VBOXCURVNET_SET(ifp->if_vnet); 501 526 502 527 if (fDst & INTNETTRUNKDIR_WIRE) … … 540 565 ifp->if_input(ifp, m); 541 566 } 567 VBOXCURVNET_RESTORE(); 542 568 return VINF_SUCCESS; 543 569 } … … 557 583 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 558 584 585 VBOXCURVNET_SET_FROM_UCRED(); 559 586 NOREF(pvContext); 560 587 ifp = ifunit(pThis->szName); … … 603 630 vboxNetFltRelease(pThis, true /*fBusy*/); 604 631 } 632 VBOXCURVNET_RESTORE(); 605 633 606 634 return VINF_SUCCESS; … … 612 640 613 641 ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); 642 VBOXCURVNET_SET(ifp->if_vnet); 614 643 /* 615 644 * Attempt to check if the interface is still there and re-initialize if … … 629 658 vboxNetFltOsInitInstance(pThis, NULL); 630 659 } 660 VBOXCURVNET_RESTORE(); 631 661 632 662 return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); … … 670 700 671 701 ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); 702 VBOXCURVNET_SET(ifp->if_vnet); 672 703 node = ASMAtomicUoReadPtrT(&pThis->u.s.node, node_p); 673 704 … … 743 774 NG_SEND_MSG_PATH(error, node, msg, path, 0); 744 775 } 776 VBOXCURVNET_RESTORE(); 745 777 } 746 778
Note:
See TracChangeset
for help on using the changeset viewer.