diff --git a/sys/pm_callouts.c b/sys/pm_callouts.c index e5c80e9..76ecd01 100644 --- a/sys/pm_callouts.c +++ b/sys/pm_callouts.c @@ -386,18 +386,20 @@ void redir(portmaster_packet_info* packetInfo, portmaster_packet_info* redirInfo // Reset routing compartment ID, as we are changing where this is going to. // This necessity is unconfirmed. + // Experience shows that using the compartment ID can sometimes cause errors. + // It seems safer to always use UNSPECIFIED_COMPARTMENT_ID. // packetInfo->compartmentId = UNSPECIFIED_COMPARTMENT_ID; if (packetInfo->direction == 0) { // INFO("Send: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkSendAsync(handle, NULL, 0, - packetInfo->compartmentId, inject_nbl, free_after_inject, + UNSPECIFIED_COMPARTMENT_ID, inject_nbl, free_after_inject, packet); INFO("InjectNetworkSend executed: %s", print_packet_info(packetInfo)); } else { // INFO("Recv: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkReceiveAsync(handle, NULL, 0, - packetInfo->compartmentId, packetInfo->interfaceIndex, + UNSPECIFIED_COMPARTMENT_ID, packetInfo->interfaceIndex, packetInfo->subInterfaceIndex, inject_nbl, free_after_inject, packet); INFO("InjectNetworkReceive executed: %s", print_packet_info(packetInfo)); @@ -572,13 +574,13 @@ void respondWithVerdict(UINT32 id, verdict_t verdict) { if (packetInfo->direction == 0) { // INFO("Send: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkSendAsync(handle, NULL, 0, - packetInfo->compartmentId, inject_nbl, free_after_inject, + UNSPECIFIED_COMPARTMENT_ID, inject_nbl, free_after_inject, packet); INFO("InjectNetworkSend executed: %s", print_packet_info(packetInfo)); } else { // INFO("Recv: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkReceiveAsync(handle, NULL, 0, - packetInfo->compartmentId, packetInfo->interfaceIndex, + UNSPECIFIED_COMPARTMENT_ID, packetInfo->interfaceIndex, packetInfo->subInterfaceIndex, inject_nbl, free_after_inject, packet); INFO("InjectNetworkReceive executed: %s", print_packet_info(packetInfo)); @@ -649,13 +651,13 @@ void copy_and_inject(portmaster_packet_info* packetInfo, PNET_BUFFER nb, UINT32 if (packetInfo->direction == 0) { // INFO("Send: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkSendAsync(handle, NULL, 0, - packetInfo->compartmentId, inject_nbl, free_after_inject, + UNSPECIFIED_COMPARTMENT_ID, inject_nbl, free_after_inject, packet); INFO("InjectNetworkSend executed: %s", print_packet_info(packetInfo)); } else { // INFO("Recv: nbl_status=0x%x, %s", NET_BUFFER_LIST_STATUS(inject_nbl), print_ipv4_packet(packet)); status = FwpsInjectNetworkReceiveAsync(handle, NULL, 0, - packetInfo->compartmentId, packetInfo->interfaceIndex, + UNSPECIFIED_COMPARTMENT_ID, packetInfo->interfaceIndex, packetInfo->subInterfaceIndex, inject_nbl, free_after_inject, packet); INFO("InjectNetworkReceive executed: %s", print_packet_info(packetInfo));