Changeset 57912 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin
- Timestamp:
- Sep 27, 2015 12:36:44 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102884
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r57904 r57912 941 941 * A packet from the host to a guest. As we won't pass it 942 942 * to the drvier/wire we need to feed it to bpf ourselves. 943 * 944 * XXX: TODO: bpf should be done before; use pfnPreRecv? 943 945 */ 944 946 if (fSrc == INTNETTRUNKDIR_HOST) 945 947 { 946 948 bpf_tap_out(pThis->u.s.pIfNet, DLT_EN10MB, pMBuf, NULL, 0); 949 ifnet_stat_increment_out(pThis->u.s.pIfNet, 1, mbuf_len(pMBuf), 0); 947 950 } 948 951 } … … 1151 1154 /* 1152 1155 * Create a mbuf for the gather list and push it onto the wire. 1156 * BPF tap and stats will be taken care of by the driver. 1153 1157 */ 1154 1158 if (fDst & INTNETTRUNKDIR_WIRE) … … 1167 1171 /* 1168 1172 * Create a mbuf for the gather list and push it onto the host stack. 1173 * BPF tap and stats are on us. 1169 1174 */ 1170 1175 if (fDst & INTNETTRUNKDIR_HOST) … … 1175 1180 void *pvEthHdr = mbuf_data(pMBuf); 1176 1181 unsigned const cbEthHdr = 14; 1182 struct ifnet_stat_increment_param stats; 1183 1184 RT_ZERO(stats); 1185 stats.packets_in = 1; 1186 stats.bytes_in = mbuf_len(pMBuf); /* full ethernet frame */ 1177 1187 1178 1188 mbuf_pkthdr_setrcvif(pMBuf, pIfNet); … … 1181 1191 1182 1192 bpf_tap_in(pIfNet, DLT_EN10MB, pMBuf, pvEthHdr, cbEthHdr); 1183 errno_t err = ifnet_input(pIfNet, pMBuf, NULL);1193 errno_t err = ifnet_input(pIfNet, pMBuf, &stats); 1184 1194 if (err) 1185 1195 rc = RTErrConvertFromErrno(err);
Note:
See TracChangeset
for help on using the changeset viewer.