raw sockets/wireshark

This is a discussion on raw sockets/wireshark within the Networking/Device Communication forums, part of the General Programming Boards category; I have code that sends and receives using RAW sockets. When I have wireshark capturing on the interface, my code ...

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    7

    raw sockets/wireshark

    I have code that sends and receives using RAW sockets. When I have wireshark capturing on the interface, my code receives the packet. Else, my code waits in the recvfrom(). What would cause something like this? Why would running wireshark affecting the program?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    When I have wireshark capturing on the interface, my code receives the packet
    What packet? I don't think you've done a very good job explaining your problem.
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,671
    I guess it has something to do this this...
    Linux raw socket
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    May 2011
    Posts
    7
    Yes, it is in reference to the 'Linux raw socket' post. Sorry I didnt explain it well. I have code that sends packets (pre-canned headers etc) from eth0. Based on information in the packet, the packet will either come back on eth0 or eth1. When I also have wireshark running listening on the interface, I am getting the packets that are supposed to come back on eth0. (Note: it also captures the packet I send. So I do some filtering). But when I stop wireshark, my code just waits on that recvfrom().

  5. #5
    Registered User
    Join Date
    May 2011
    Posts
    7
    I put both interfaces in promiscuous mode and now everything works fine.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet Sniffing error [Wireshark etc]
    By C_ntua in forum Windows Programming
    Replies: 1
    Last Post: 06-22-2010, 03:54 PM
  2. Sockets tutorial, datagram sockets example not working for me
    By caesius in forum Networking/Device Communication
    Replies: 14
    Last Post: 12-26-2009, 02:40 PM
  3. Sockets
    By Korhedron in forum Networking/Device Communication
    Replies: 9
    Last Post: 04-24-2004, 09:52 PM
  4. ssl sockets
    By champ in forum Linux Programming
    Replies: 1
    Last Post: 04-05-2003, 11:51 PM
  5. Sockets
    By Twiggy in forum Windows Programming
    Replies: 8
    Last Post: 03-31-2003, 08:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21