Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-16 Thread Patrick McHardy
Joan Raventos wrote: Is this a bug in PF_PACKET? Should the socket queue be emptied by packet_set_ring (called via setsockopt when PACKET_RX_RING is used) so the above cannot happen? Should the user-space app drain the socket queue with recvfrom prior to (4) -quite unlikely in practice-? I

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-16 Thread Joan Raventos
Is this a bug in PF_PACKET? Should the socket queue be emptied by packet_set_ring (called via setsockopt when PACKET_RX_RING is used) so the above cannot happen? Should the user-space app drain the socket queue with recvfrom prior to (4) -quite unlikely in practice-? I guess the best way is not

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-15 Thread Patrick McHardy
Joan Raventos wrote: Hello, In order to use PF_PACKET/SOCK_RAW with PACKET_RX_RING one would possibly do (as described in Documentation/networking/packet_mmap.txt): 1. setup PF_PACKET socket via socket call. 2. use setsockopt to change the PF_PACKET socket into PACKET_RX_RING mode and

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-15 Thread Joan Raventos
Hi Patrick, Thx for your prompt reply! Plz see some comments inline. Is this a bug in PF_PACKET? Should the socket queue be emptied by packet_set_ring (called via setsockopt when PACKET_RX_RING is used) so the above cannot happen? Should the user-space app drain the socket queue with