ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Today i tried
BIND (though bind call was succesful )too but that also not working
As per man pages only sa.sll_protocol and sa.sll_ifindex are required for BIND
correct me if i am wrong ?
also the print of sa.sll_ifindex is coming out 0 , i dont konw why???
Actually I am using Bonded interface where bond2 is bonded of eth4 and eth 5
Am i using it in wrong way ??
memset(&sa, 0, sizeof(sa));
sa.sll_family = AF_PACKET;
interfaceId = ioctl(g_frame_read_sockfd ,SIOCGIFINDEX,&ifr);
printf("INTERFACE ID =%d\n",interfaceId); /*Its giving 0 as OUTPUT of Inteergfasc id */
sa.sll_protocol = htons(ETH_P_ALL);
// sa.sll_hatype = 1;
// sa.sll_pkttype = PACKET_HOST;
//sa.sll_halen = 18;
sa.sll_ifindex = interfaceId;
I know, this is old, but I found it with google. I had the opposite problem: I wanted all packages, even the sent ones. But I bound it to a specific Ethernet Type (eg. 0x1234). Because of this, the Kernel seems to Filter outgoing packages wrong (incoming are filtered correctly). I then used ETH_P_ALL when bind.
To do the filtering by Ethernet Type I used a BPF (see here)