On Wed, Mar 08, 2000 at 10:42:59AM +0300, Yuri Polyanski wrote:
> Hi, all!
>
> I've a little trouble with packet socket.
> Creating socket like this:
>
> ps=socket(PF_PACKET,SOCK_RAW,ETH_P_ALL);
....
> q.sll_pkttype=PACKET_HOST;
>
> bind(rs,(struct sockaddr *)&q,sizeof(struct sockaddr_ll));
>
> Binding also returns success, but when i monitor received from this
> socket packets, i see that it also receives broadcasts. And when device in
> promisc-mode it receives all packets.
I don't have all of the answers, but it is quite natural
that this method receives all:
- host directed packets
- LAN broadcasts (*every* host in the LAN segment must
receive them -- that is what a 'broadcast' means..)
- Multicast packets which anybody in the host is
interested in (so that network interface lets them
thru MAC filter -- if it uses any. Some network cards
treat multicast packets same as broadcasts and pick
them all.)
Promiscuous mode is network snooper by design, and receives
all packets it can get.
> P.S. Kernel is 2.2.14
> ICQ #52224443 mailto: [EMAIL PROTECTED] IRC Dalnet: Kalhown
/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]