Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:29:57+00:00 2026-06-12T18:29:57+00:00

I’m making program that should receive packet and send it on the other port

  • 0

I’m making program that should receive packet and send it on the other port on PC (other port is doing the same, also send what he gets), based on MAC address. But when I open device like this:

device_port1.Open(DeviceMode.Promiscuous);

and then send some packet on one port, that same port get that same packet like it was received. And when both adapters are doing the same, they are sending each other one packet over and over.

How could I stopped this? I tried

device_port1.Open(OpenFlags.NoCaptureLocal, 1000);

but then it wasn’t sending anything thru that program (and then it’s useless).

This is the code:

        device_port0 = devices[pole[0]];
        device_port0.OnPacketArrival += new SharpPcap.PacketArrivalEventHandler(device_OnPacketArrival_port0);
        //device_port0.Open(OpenFlags.NoCaptureLocal, 1000);
        device_port0.Open(DeviceMode.Promiscuous);
        device_port0.StartCapture();

And onPacketArrival

private void device_OnPacketArrival_port0(object sender, CaptureEventArgs packet)
        {
            device_port1 = devices[pole[1]];
            device_port1.Open();

            try
            {
                device_port1.SendPacket(packet.Packet.Data);
            }
            catch (Exception ee)
            {
                Console.Writeline("Exception: " + ee.Message);
            }
        }

And on the port1 is the same. It just send what he gets and that’s the reason for the loop.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:29:58+00:00Added an answer on June 12, 2026 at 6:29 pm

    I take it both Network cards have the same address? If that is NOT the case then, before forwarding a packet you have to check if the packet’s destination network is the network connected to the second network card.

    If however both cards have the same address, then the only solution i can see (I’m no expert) is to have some sort of list where you store the packets for a short time after sending them. And every time you capture a packet you check if it already is in the list(to check if it’s one you’ve already sent). This way of solving your problem is inefficient as every packet sent is resent back again But it beats infinity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.