Berkeley Packet Filter

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Berkeley Packet Filter

661 Views
JohannesPetzold
Contributor I

Hi,

I have some problem with filtering some packets using the setsockopt function.

Following Code doesn't work on an iMX6 platform:

struct sock_filter cams[] =
{

      BPF_STMT(BPF_RET + BPF_K, 0)

}

setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &cams, sizeof(cams));

"Invalid argument" is returned as errno. Similiar Code can be found in libpcap where this seems to work. Any ideas?

Tags (1)
0 Kudos
0 Replies