PF_PACKET and Orinoco driver

Posted on 2003-03-07
Medium Priority
Last Modified: 2008-02-01
Hi, I am currently writing a program to send Raw packet( 802.3 compliance) using PF_PACKET with SOCK_RAW option. However, in using sendto() function, some strange thing happened. If I declare my data as
char message[60]
and contruct my message as a 802.3 frame

then I call: sendto(packet_socket, message, sizeof(message), 0, (struct sockaddr *) &recv_addr, tolen)

the sendto function return normal, send out 60 bytes, however. if I check: /proc/net/dev, I have the number of packet that I have transmitted (in this case 1) at transmit/errs column. 0 at transmit/packet column

If then I declare: char *message
contruct my message
and call: sendto(packet_socket, message, sizeof(message), 0, (struct sockaddr *) &recv_addr, tolen)

the sendto function also return sucessful transmit, and /proc/net/dev then return 1 packet is transmit and no errs. However I receiver sde, I received 0 length message

Any ideas why? I am using kernel version: 2.4.18-14 and trying to send and receive data through Orinoco card (with Orinoco driver build in)

Thank you for your time


Question by:pinegrass
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8135818
For you second configuration (using char *), you mentioned that at the receiver side, you received "0 length" message. Where did you get that? Did you use Ethereal or IPTraf to double check that?

I have done something very similar to your case. I've tried using char[] and char*, and i successfully sent the packet out (sendto() return the packet size). I am not sure if those are "transmit/errs" or "transmit/packet" (this is the first time i came across them), but at least at the receiver side, my Ethereal and IPTraf had verified that they had received such packets.

Maybe the error is from your IP header's checksum field. Did you fill in the correct checksum value for that particular packet?? Maybe that's where the problem came from.


Author Comment

ID: 8135850
Hi, I have sucessful send out the packet by just changing the SOCK_RAW option to SOCK_DGRAM option. I don't know how it works but simply working correctly after changing the field ;)

Anyway, thanks for your answer

Expert Comment

ID: 9077714
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Accepted Solution

modulo earned 0 total points
ID: 13224017
PAQed with points refunded (80)

Community Support Moderator

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question