LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-02-2014, 01:41 PM   #1
kamil_b90
LQ Newbie
 
Registered: Jul 2014
Posts: 1

Rep: Reputation: Disabled
Packet socket not receive data


Hi everyone,
First of all I want apologise for my poor english. I have a problem with packet socket and can't find solution for 2 weeks. I create application responsible for network sniffing, one socket for send data ( socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) and second for receive (socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)). When I start monitoring network I can't see any data, but when I first send data through sendto function, packet socket start working, receiving packets and everything works fine. For receive I use recvfrom function. I have no idea where is problem. I suppose it is problem with kernel (my version is 3.1.5). Do you have any idea what can be a problem ?
 
Old 07-11-2014, 02:35 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The 'socket' function doesn't sent out any packet. Only 'sendto' function send out a real packet.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Receive Ethernet VLAN frame on the native ethernet interface (raw packet socket) scottbiker Linux - Networking 0 07-13-2009 03:49 AM
Receive a packet from L2 header using socket murugan86 Programming 1 03-26-2009 10:48 PM
How to send and receive data from a single socket in perl?? murahman Programming 0 07-28-2008 03:29 AM
Unable to receive data in an udp socket stephenwalter Programming 8 11-24-2005 11:20 PM
Packet socket and socket filtring Baran Linux - Newbie 4 10-09-2003 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration