VirtualBox

Ignore:
Timestamp:
Sep 25, 2015 7:57:12 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102876
Message:

VBoxNetFlt/darwin, VBoxNetAdp/darwin: Don't leak host-guest traffic to
the wire when the interface is in promiscuous mode. Call bpf_tap_in
and bpf_tap_out in the filter. Adjust VBoxNetAdp accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp

    r57358 r57904  
    144144static errno_t vboxNetAdpDarwinOutput(ifnet_t pIface, mbuf_t pMBuf)
    145145{
    146     PVBOXNETADP pThis = VBOXNETADP_FROM_IFACE(pIface);
    147     Assert(pThis);
    148     if (pThis->u.s.nTapMode & BPF_MODE_OUTPUT)
    149     {
    150         Log2(("vboxnetadp: out len=%d\n%.*Rhxd\n", mbuf_len(pMBuf), 14, mbuf_data(pMBuf)));
    151         bpf_tap_out(pIface, DLT_EN10MB, pMBuf, NULL, 0);
    152     }
     146    /*
     147     * We are a dummy interface with all the real work done in
     148     * VBoxNetFlt bridged networking filter.  If anything makes it
     149     * this far, just drop it, we have nowhere to send it to.
     150     */
    153151    mbuf_freem_list(pMBuf);
    154152    return 0;
     
    205203                                     protocol_family_t *pProtocolFamily)
    206204{
    207     PVBOXNETADP pThis = VBOXNETADP_FROM_IFACE(pIface);
    208     Assert(pThis);
    209     Log2(("vboxNetAdpDarwinDemux: mode=%d\n", pThis->u.s.nTapMode));
    210     if (pThis->u.s.nTapMode & BPF_MODE_INPUT)
    211     {
    212         Log2(("vboxnetadp: in len=%d\n%.*Rhxd\n", mbuf_len(pMBuf), 14, pFrameHeader));
    213         bpf_tap_in(pIface, DLT_EN10MB, pMBuf, pFrameHeader, ETHER_HDR_LEN);
    214     }
     205    /*
     206     * Anything we get here comes from VBoxNetFlt bridged networking
     207     * filter where it has already been accounted for and fed to bpf.
     208     */
    215209    return ether_demux(pIface, pMBuf, pFrameHeader, pProtocolFamily);
    216210}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette