Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2018 22:15:03 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Reshad Patuck <reshadpatuck1@gmail.com>, freebsd-net@freebsd.org
Subject:   Re: [netgraph] ng_bpf filter large list of IP addresses
Message-ID:  <5AE09B77.3090607@grosbein.net>
In-Reply-To: <EFFB436D-3A09-4D91-88F1-D641993BBED3@gmail.com>
References:  <D4E00F05-F64D-4446-A572-E1A0E06B2C47@gmail.com> <5AC118E8.1020800@grosbein.net> <EFFB436D-3A09-4D91-88F1-D641993BBED3@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
25.04.2018 21:40, Reshad Patuck пишет:
> Hey,
> ​
> I have tried to write some c code to add a bpf filter to my ng_bpf node, but its just segfaulting.
> My c is not good enough to debug this.
> ​
> What baffles me is that when I load a filter for 250 IP addresses using the command in this link https://paste.ee/d/BHOoG/3 it loads fine.
> If I use 'ngctl -f' with the file in this link https://paste.ee/d/BHOoG/2 I get an error saying 'ngctl: send msg: Invalid argument; ngctl: line 1: error in file'
> The BPF filter and arguments in that command are exactly the same.
> ​
> My problem is that I need to load thousands of IP addresses in a blocking filter, which I am not able to pass over a command line because the list becomes too long and I hit either the kern.argmax limit of 262144 bytes or the LINE_MAX (2048) for ngctl.
> ​
> I can share the c code I am using to attempt this using NgSendAsciiMsg(), but I don't think that would be too useful.

Have you tried changing limits in ngctl's sources and recompile it?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5AE09B77.3090607>