Thread (3 messages) flat view 3 messages, 2 authors, 2012-03-22

Query regarding pf_packet sockets

From: Prashant Batra (prbatra) <hidden>
Date: 2012-03-22 03:32:50

Hi ,

I am trying to use PF_PACKET socket along with filters applied on the socket through setsockopt, SO_ATTACH_FILTER.
Now as I create this socket, any packet coming to the kernel would be copied into the socket buffer for this socket.

So, even if I apply the filter, first few packets would always be those which do not match the filter. 

Is there a way (some socket option),  to make socket passive and active, so that I will set the socket in passive mode after creation, 
and then set it as active, after I apply the filter, so that I only receive the filtered packet in user space.

Thanks,
Prashant
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help