Arp response issues

Home Forums Discussions Support Arp response issues

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12937
    EphronInc
    Participant

      I’m wondering if you can tell me why this arp response is not being received. There are no exceptions. The code below returns a response within the same code block as the arp request. My full code example is based on your .NET demo.

      
      var reply = new ArpPacket(ArpOperation.Response, arpPacket.SenderHardwareAddress, arpPacket.SenderProtocolAddress, new System.Net.NetworkInformation.PhysicalAddress(new byte[] { 0, 21, 93, 6, 35, 240 }), arpPacket.TargetProtocolAddress);
      var ethRequest = new NdisApiDotNet.Native.NdisApi.ETH_REQUEST();
      ethRequest.hAdapterHandle = activeAdapeter.Handle;
      fixed (byte* response = reply.Bytes)
      {
      ethRequest.EthPacket.Buffer = (nint)response;
      var buffer = *(ethRequest.EthPacket.GetIntermediateBuffer());
      buffer.m_Length = (uint)reply.Bytes.Length;
      filter.SendPacketToAdapter(ref ethRequest);
      Console.WriteLine($"ARP Reply: {reply.SenderProtocolAddress} {reply.SenderHardwareAddress} -> {reply.TargetProtocolAddress} {reply.TargetHardwareAddress}");
      }
      }
      
      #12940
      Vadim Smirnov
      Keymaster

        Apologies for any confusion. To clarify, the SendPacketToAdapter function provides the capability to send any arbitrary Ethernet frame to the network, regardless of its content or structure. This includes both well-formed packets and those that are malformed or contain pure garbage. If the adapter handle is correct, you can have confidence that the packet was successfully transmitted to the intended destination.

        If the packet was not received by the destination host, it is recommended that you verify the packet’s correctness. Errors in the packet structure, content, or addressing information may cause it to be dropped or not processed by the receiving host. Ensure that the packet adheres to the relevant protocol specifications and that all required fields are correctly populated.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.