[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Promiscuous Ethernet problem


We have to investigate this. I agree that it seams incorrect
that only unicast and broadcasts are recevied after the
kernel has printed device "eth0 entered promiscuous mode".

If you want to investigate yourself I suggest that you
add a debug printout in set_multicast_list i 
os/linux/arch/cris/drivers/ethernet.c and recompile the


-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of ulf.sjostedt@xxxxxxx.se
Sent: Monday, July 01, 2002 4:40 PM
To: dev-etrax
Subject: Promiscuous Ethernet problem

Hi there!

I'm working on an application for the ETRAX 100 LX, which is
supposed to read all packets from the Ethernet port.

The ETRAX is out-of-the-box, except two things:
I have set an IP address in /etc/network/network.cnf.
My application resides on /mnt/flash.

I open a raw socket, and set the interface to promiscuous mode
using setsockopt.
When I start the program, I get a message on the serial debug port
telling me that "device eth0 entered promiscuous mode".

When I terminate the program, I get the message
"device eth0 left promiscuous mode".

However, the only packets received by my application are those
addressed to the ETRAX's own MAC address or the broadcast
address (ff:ff:ff:ff:ff:ff).

What am I doing wrong?

Here's how I set up the interface:

int s;
struct packet_mreq pr;
struct ifreq ir;

s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
ioctl(s, SIOCGIFINDEX, &ir);
pr.mr_ifindex = ir.ifr_ifindex;
pr.mr_type = PACKET_MR_PROMISC;
           &pm, sizeof(struct packet_mreq));

None of the system calls fail, and as I said above, the OS reports
that the interface has gone promiscuous.

Any help is appreciated.

/Ulf Sjöstedt
SaabTech Systems