fcode.filter = (struct sock_filter *) handle->fcode.bf_insns;
fcode.len = filter->bf_len;
+#ifdef USHRT_MAX
if( filter->bf_len > USHRT_MAX ) {
fprintf( stderr, "Warning: Filter to complex for kernel\n" );
/* paranoid - should never happen */
}
- else if( setsockopt(handle->fd, SOL_SOCKET, SO_ATTACH_FILTER,
+ else
+#endif
+ if( setsockopt(handle->fd, SOL_SOCKET, SO_ATTACH_FILTER,
&fcode, sizeof(fcode)) == 0 )
{
handle->md.use_bpf = 1;
/* Select promiscous mode on/off */
+#ifdef SOL_PACKET
/* XXX: We got reports that this does not work in 2.3.99.
* Need to investigate. Using ioctl to switch the promisc
* mode at device level costs us most of the benefits of
"setsockopt: %s", pcap_strerror(errno));
break;
}
+#endif
/* Compute the buffersize */