mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: gil.beniamini@gmail.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: SOCK_RAW does not receive broadcast (with VLAN unless PROMISC)
Date: Mon, 08 Jun 2009 14:34:54 -0700 (PDT)	[thread overview]
Message-ID: <20090608.143454.161329513.davem@davemloft.net> (raw)
In-Reply-To: <91ac27070906081105x30171bedra10d244d382a6934@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 2195 bytes --]

From: Gil Beniamini <gil.beniamini@gmail.com>
Date: Mon, 8 Jun 2009 21:05:25 +0300

> Dear Linux Experts,
> 
> My application is using PF_PACKET and SOCK_RAW in order to receive all
> Ethernet packets for the machine-unicast MAC plus all broadcast
> packets (like ARP broadcast).

Please post networking questions and reports to netdev@vger.kernel.org
which is where the networking experts are subscribed.

I am also fully aware of your problem as Linus Torvalds forwarded
your report to me last week, you just need to be patient as I simply
haven't had a chance to look into it yet.

> That worked OK with kernel 2.6.20 (Ubuntu 7.04 with or without VLAN).
> 
> Now with kernel 2.6.28 (Ubuntu 9.04) it works OK only without-VLAN,
> but with VLAN the application receive only packets for the
> machine-unicast MAC, but no broadcast (like ARP broadcast) packets,
> only if I set the socket to PROMISC mode, I start receive also
> broadcast packets.
> 
> To me it seems a bug, as SOCK_RAW should pass all ‘received’ packet
> (including broadcast) to the application, without the need for PROMISC
> (which cause my machine to receive other machine unicast  packets, and
> filter those by software)!
> 
> The original application:
> 
> sock=socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
> memset((char *) &sockad, 0, sizeof(sockad));
> sockad.sll_family = PF_PACKET;
> sockad.sll_protocol = htons(ETH_P_ALL);
> sockad.sll_ifindex = ethreq.ifr_ifindex;//the relevant unit number
> 
> 
> 
> Now the workaround is to set (unwanted) PROMISC mode:
> 
> ioctl(sock,SIOCGIFFLAGS,&ethreq);
> ethreq.ifr_flags|=IFF_PROMISC; // why does 9.04 need this (+0x100) at
> least once?!
> ioctl(sock,SIOCSIFFLAGS,&ethreq);
> 
> 
> Many thanks in advance,
> Gil Beniamini
> gil.beniamini@gmail.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  parent reply	other threads:[~2009-06-08 21:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 18:05 Gil Beniamini
2009-06-08 18:48 ` Alan Cox
2009-06-08 21:34 ` David Miller [this message]
2009-06-09 10:59   ` Patrick McHardy
2009-06-09 11:27     ` Gil Beniamini
2009-06-09 11:40       ` Patrick McHardy
2009-06-09 13:08         ` Gil Beniamini
2009-06-09 13:14           ` Patrick McHardy
2009-06-09 19:30           ` Brent Cook
2009-06-10 14:24             ` Gil Beniamini
2009-06-10 14:32               ` Patrick McHardy
2009-06-10 14:48                 ` Gil Beniamini
2009-06-10 15:00                   ` Patrick McHardy
     [not found]                   ` <20090610170108.7710c64b@tux.DEF.witbe.net>
2009-06-10 15:29                     ` Gil Beniamini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090608.143454.161329513.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=gil.beniamini@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®